/**
 * Novavia Auth Modal Styles
 * Light/Dark mode support with Google Material Icons
 */

/* ============================================
   Auth Modal Overlay
   ============================================ */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}

.auth-modal.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Modal Container
   ============================================ */

.auth-modal-container {
    background: var(--color-bg-card, #111c2a);
    border-radius: 1rem;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-modal.active .auth-modal-container {
    transform: translateY(0);
}

/* Light mode */
@media (prefers-color-scheme: light) {
    .auth-modal-container {
        background: #ffffff;
        border: 1px solid #e5e5e5;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    }
}

/* ============================================
   Modal Header
   ============================================ */

.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 0;
}

.auth-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary, #ffffff);
}

@media (prefers-color-scheme: light) {
    .auth-modal-title {
        color: #171717;
    }
}

.auth-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--color-text-muted, #71849e);
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary, #ffffff);
}

@media (prefers-color-scheme: light) {
    .auth-modal-close:hover {
        background: rgba(0, 0, 0, 0.05);
        color: #171717;
    }
}

/* ============================================
   Tabs
   ============================================ */

.auth-tabs {
    display: flex;
    gap: 0;
    padding: 1.5rem 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (prefers-color-scheme: light) {
    .auth-tabs {
        border-bottom-color: #e5e5e5;
    }
}

.auth-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--color-text-muted, #71849e);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.auth-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: background 0.2s;
}

.auth-tab:hover {
    color: var(--color-text-secondary, #aabcd6);
}

.auth-tab.active {
    color: var(--color-primary, #00C9FF);
}

.auth-tab.active::after {
    background: var(--color-primary, #00C9FF);
}

@media (prefers-color-scheme: light) {
    .auth-tab:hover {
        color: #525252;
    }

    .auth-tab.active {
        color: #0891b2;
    }

    .auth-tab.active::after {
        background: #0891b2;
    }
}

/* ============================================
   Modal Body
   ============================================ */

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

/* ============================================
   Google Sign In Button
   ============================================ */

.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: #131314;
    border: 1px solid #8e918f;
    border-radius: 0.5rem;
    color: #e3e3e3;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.auth-google-btn:hover {
    background: #131314;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    border-color: #c7c7c7;
}

.auth-google-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-google-btn svg {
    width: 20px;
    height: 20px;
}

@media (prefers-color-scheme: light) {
    .auth-google-btn {
        background: #ffffff;
        border: 1px solid #dadce0;
        color: #3c4043;
    }

    .auth-google-btn:hover {
        background: #f8f9fa;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border-color: #dadce0;
    }
}

/* ============================================
   Divider
   ============================================ */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: var(--color-text-muted, #71849e);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

@media (prefers-color-scheme: light) {

    .auth-divider::before,
    .auth-divider::after {
        background: #e5e5e5;
    }
}

/* ============================================
   Forms
   ============================================ */

.auth-form {
    display: none;
}

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

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

.auth-form-row {
    display: flex;
    gap: 0.75rem;
}

.auth-form-row .auth-form-group {
    flex: 1;
}

.auth-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary, #aabcd6);
}

@media (prefers-color-scheme: light) {
    .auth-label {
        color: #525252;
    }
}

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    color: var(--color-text-primary, #ffffff);
    font-size: 0.9375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input::placeholder {
    color: var(--color-text-muted, #71849e);
}

.auth-input:focus {
    outline: none;
    border-color: var(--color-primary, #00C9FF);
    box-shadow: 0 0 0 3px rgba(0, 201, 255, 0.15);
}

@media (prefers-color-scheme: light) {
    .auth-input {
        background: #ffffff;
        border: 1px solid #d4d4d4;
        color: #171717;
    }

    .auth-input::placeholder {
        color: #a3a3a3;
    }

    .auth-input:focus {
        border-color: #0891b2;
        box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
    }
}

/* ============================================
   Password Feedback
   ============================================ */

.password-feedback {
    min-height: 1.25rem;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    transition: color 0.2s;
}

.password-feedback.error {
    color: #ef4444;
}

.password-feedback.success {
    color: #22c55e;
}

/* ============================================
   Gmail Hint
   ============================================ */

.gmail-hint {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(8, 145, 178, 0.1);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: var(--color-primary, #00C9FF);
}

.gmail-hint.visible {
    display: flex;
}

.gmail-hint-btn {
    margin-left: auto;
    padding: 0.25rem 0.75rem;
    background: var(--color-primary, #00C9FF);
    border: none;
    border-radius: 0.25rem;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.gmail-hint-btn:hover {
    opacity: 0.9;
}

@media (prefers-color-scheme: light) {
    .gmail-hint {
        background: rgba(8, 145, 178, 0.08);
        color: #0891b2;
    }
}

/* ============================================
   Submit Button
   ============================================ */

.auth-submit-btn {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--gradient-primary, linear-gradient(135deg, #00C9FF 0%, #0EA5E9 50%, #1E3A8A 100%));
    border: none;
    border-radius: 0.5rem;
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.auth-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 201, 255, 0.3);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (prefers-color-scheme: light) {
    .auth-submit-btn {
        background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    }

    .auth-submit-btn:hover:not(:disabled) {
        box-shadow: 0 4px 20px rgba(8, 145, 178, 0.25);
    }
}

/* ============================================
   Messages
   ============================================ */

.auth-error,
.auth-success {
    display: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.auth-error.visible,
.auth-success.visible {
    display: block;
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.auth-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.auth-switch-link {
    color: var(--color-primary, #00C9FF);
    text-decoration: underline;
    cursor: pointer;
}

@media (prefers-color-scheme: light) {
    .auth-switch-link {
        color: #0891b2;
    }
}



/* ============================================
   Responsive
   ============================================ */

@media (max-width: 480px) {
    .auth-modal-container {
        max-height: 100vh;
        border-radius: 0;
    }

    .auth-form-row {
        flex-direction: column;
        gap: 0;
    }

    .user-name {
        display: none;
    }
}

/* ============================================
   Password Requirements List
   ============================================ */

.password-requirements {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.password-requirements.visible {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-muted, #71849e);
    transition: color 0.2s;
}

.requirement-item .material-icons-outlined {
    font-size: 14px;
    transition: color 0.2s, transform 0.2s;
}

.requirement-item.valid {
    color: #22c55e;
}

.requirement-item.valid .material-icons-outlined {
    color: #22c55e;
    transform: scale(1.1);
}

@media (prefers-color-scheme: light) {
    .password-requirements {
        background: #f9fafb;
        /* Light gray background for the list */
        border: 1px solid #e5e7eb;
    }

    .requirement-item {
        color: #6b7280;
    }
}