/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 2rem;
    padding: 0;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
}

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

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    color: var(--text-dark);
    line-height: 1.8;
    flex: 1;
}

.auth-modal .modal-body {
    padding: 1.5rem;
}

/* Custom scrollbar for modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Auth Modal Specific Styles */
.auth-modal .modal-content {
    max-width: 450px;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.auth-tab:hover {
    color: var(--text-dark);
    background: var(--bg-light);
}

.auth-tab.active {
    color: var(--primary-color);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.auth-form-container {
    display: none;
}

.auth-form-container.active {
    display: block;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.auth-form input {
    width: 100%;
    padding: 0.7rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
    font-family: inherit;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.auth-form .btn-submit {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.auth-form .btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
}

.auth-form .btn-submit:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Error Message Styles */
.auth-error-message {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c33;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    animation: slideDown 0.3s ease-out;
}

/* Field-specific error messages */
.field-error {
    display: block;
    color: #dc3545;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
    line-height: 1.4;
    animation: fadeIn 0.2s ease-out;
}

/* Form-level error messages (above submit buttons) */
.form-error {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background-color: #fff5f5;
    border: 1.5px solid #fca5a5;
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.1);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.auth-link {
    text-align: center;
    margin-top: 0.75rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.auth-link a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.75rem 0 1rem 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider::before {
    margin-right: 1rem;
}

.auth-divider::after {
    margin-left: 1rem;
}

.password-requirements {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.password-requirements ul {
    margin: 0.5rem 0 0 1.25rem;
    padding: 0;
}

.password-requirements li {
    margin: 0.25rem 0;
}

.password-requirements li.valid {
    color: var(--success-color);
}

.password-requirements li.invalid {
    color: var(--text-light);
}

.social-login {
    margin-bottom: 1rem;
}

.social-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-social:hover:not(:disabled) {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.2);
}

.btn-social:disabled {
    cursor: default;
    opacity: 1;
}

.btn-social svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-social.google:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: #fff5f2;
}

.btn-social.twitter:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: #fff5f2;
}

/* Loading Overlay */
.auth-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    border-radius: 16px;
    animation: fadeIn 0.2s ease-out;
}

.auth-loading-content {
    text-align: center;
}

.auth-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-loading-message {
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
    }

    .modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .auth-modal .modal-content {
        max-width: 95%;
    }

    .auth-modal .modal-body {
        padding: 1.25rem;
    }
}

/* Coming Soon Overlay */
.coming-soon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 0 0 16px 16px;
    animation: fadeIn 0.3s ease-out;
}

.coming-soon-content {
    text-align: center;
    padding: 2rem;
}

.coming-soon-content h3 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.coming-soon-content p {
    font-size: 1rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.6;
}

