/* ===================================================================== */
/* AUTHENTICATION SYSTEM STYLES */
/* Modal design, forms, and user interface components */
/* ===================================================================== */

/* Modal Base Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal[style*="display: block"] {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s ease-out;
}

.modal-content.large {
    max-width: 1200px;
    width: 95%;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.modal-header {
    position: relative;
    padding: 24px 32px 16px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

.modal-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.modal-header p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #9ca3af;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: none;
}

.close:hover,
.close:focus {
    color: #374151;
    background: #f3f4f6;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    margin-bottom: 0;
}

.auth-tab {
    flex: 1;
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.auth-tab:hover {
    color: #374151;
}

/* Modal Body */
.modal-body {
    padding: 32px;
}

/* Auth Content */
.auth-content {
    display: none;
}

.auth-content.active {
    display: block;
}

.auth-content h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: #6b7280;
    margin: 0 0 32px 0;
    font-size: 16px;
}

/* Form Styles */
.auth-form {
    max-width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-group.half-width {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.section-label {
    display: block;
    margin-bottom: 16px;
    font-weight: 700;
    color: #111827;
    font-size: 16px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.password-requirements {
    margin-top: 4px;
}

.password-requirements small {
    color: #6b7280;
    font-size: 12px;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.forgot-link {
    color: #2563eb;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Checkbox Styles */
.checkbox-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    margin-bottom: 12px;
}

.checkbox-wrapper input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    position: relative;
    width: 18px;
    height: 18px;
    background-color: white;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    margin-right: 12px;
    transition: all 0.2s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked ~ .checkmark {
    background-color: #2563eb;
    border-color: #2563eb;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-wrapper input[type="checkbox"]:checked ~ .checkmark:after {
    display: block;
}

/* Membership Selection */
.membership-selection {
    margin-bottom: 24px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.membership-options {
    display: flex;
    gap: 16px;
    flex-direction: column;
}

.membership-option {
    display: block;
    cursor: pointer;
}

.membership-option input[type="radio"] {
    display: none;
}

.option-content {
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    transition: all 0.2s ease;
}

.membership-option input[type="radio"]:checked + .option-content {
    border-color: #2563eb;
    background: #eff6ff;
}

.membership-option.premium input[type="radio"]:checked + .option-content {
    border-color: #059669;
    background: #ecfdf5;
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.option-header strong {
    font-weight: 700;
    color: #111827;
}

.price {
    font-weight: 700;
    color: #059669;
}

.feature-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

/* Form Preferences */
.form-preferences {
    margin-bottom: 20px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.form-agreement {
    margin-bottom: 24px;
}

.form-agreement .checkbox-wrapper.required {
    font-weight: 500;
}

.form-agreement a {
    color: #2563eb;
    text-decoration: none;
}

.form-agreement a:hover {
    text-decoration: underline;
}

/* Button Styles */
.btn-primary,
.btn-outline,
.btn-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    color: #374151;
    border-color: #d1d5db;
}

.btn-outline:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.btn-social {
    background: white;
    color: #374151;
    border-color: #d1d5db;
    margin-bottom: 12px;
    width: 100%;
}

.btn-social:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-social.google:hover {
    background: #fef7f7;
    border-color: #fca5a5;
}

.btn-social.linkedin:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.full-width {
    width: 100%;
}

.social-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

/* Auth Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
    color: #9ca3af;
    font-size: 14px;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
    z-index: 1;
}

.auth-divider span {
    background: white;
    padding: 0 16px;
    position: relative;
    z-index: 2;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.auth-footer p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.auth-footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Pricing Grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.pricing-card {
    position: relative;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.pricing-card.featured {
    border-color: #059669;
    position: relative;
    transform: scale(1.05);
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-4px);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #059669;
    color: white;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-header h3 {
    margin: 0 0 16px 0;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 16px;
}

.currency {
    font-size: 20px;
    font-weight: 600;
    color: #6b7280;
}

.amount {
    font-size: 48px;
    font-weight: 700;
    color: #111827;
    margin: 0 4px;
}

.period {
    font-size: 16px;
    color: #6b7280;
}

.pricing-description {
    color: #6b7280;
    margin: 0 0 32px 0;
    font-size: 14px;
    line-height: 1.5;
}

.pricing-features {
    text-align: left;
    margin-bottom: 32px;
}

.pricing-features h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.pricing-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pricing-features li {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: #374151;
}

.feature-icon {
    color: #059669;
    font-weight: bold;
    margin-right: 12px;
    width: 16px;
    text-align: center;
}

.trial-note {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #6b7280;
}

/* FAQ Section */
.membership-faq {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid #e5e7eb;
}

.membership-faq h3 {
    text-align: center;
    margin: 0 0 32px 0;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.faq-item h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.faq-item p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* Message Styles */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1001;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: messageSlideIn 0.3s ease;
}

.message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

@keyframes messageSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Premium Content Gate */
.premium-content-gate {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 2px solid #d1d5db;
    border-radius: 16px;
    padding: 48px 32px;
    text-align: center;
    margin: 32px 0;
}

.gate-content {
    max-width: 400px;
    margin: 0 auto;
}

.gate-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.premium-content-gate h3 {
    margin: 0 0 16px 0;
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

.premium-content-gate p {
    color: #6b7280;
    margin: 0 0 24px 0;
    font-size: 16px;
    line-height: 1.6;
}

.gate-benefits {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.gate-benefits h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.gate-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gate-benefits li {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #374151;
    font-size: 14px;
}

.gate-benefits li::before {
    content: "✓";
    color: #059669;
    font-weight: bold;
    margin-right: 12px;
}

.gate-footer {
    margin-top: 16px;
    font-size: 14px;
    color: #6b7280;
}

.gate-footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.gate-footer a:hover {
    text-decoration: underline;
}

/* User Menu Styles */
.user-menu {
    position: relative;
    display: none;
}

.user-info {
    padding: 8px 16px;
    background: #f3f4f6;
    border-radius: 20px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
}

.login-btn, .register-btn, .logout-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-btn:hover, .register-btn:hover, .logout-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.register-btn {
    background: #059669;
}

.register-btn:hover {
    background: #047857;
}

/* Premium Upgrade Styles */
.premium-upgrade {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #93c5fd;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    margin: 24px 0;
}

.upgrade-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.premium-upgrade h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
    color: #1e3a8a;
}

.premium-upgrade p {
    color: #3730a3;
    margin: 0 0 20px 0;
}

.upgrade-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upgrade-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-body {
        padding: 24px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .membership-options {
        flex-direction: column;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .pricing-card.featured {
        transform: none;
    }
    
    .pricing-card.featured:hover {
        transform: translateY(-4px);
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-content h2 {
        font-size: 24px;
    }
    
    .premium-content-gate {
        padding: 32px 20px;
    }
}

@media (max-width: 480px) {
    .modal-body {
        padding: 20px;
    }
    
    .auth-tab {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .btn-primary,
    .btn-outline,
    .btn-social {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .pricing-card {
        padding: 24px 16px;
    }
    
    .amount {
        font-size: 36px;
    }
}

/* Animation for content transitions */
.auth-content {
    transition: opacity 0.3s ease;
}

.auth-content:not(.active) {
    opacity: 0;
}

.auth-content.active {
    opacity: 1;
}
