/* --- Auth Modal (Glassmorphism) --- */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base), visibility var(--transition-base);
    visibility: hidden;
}

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

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    width: 95%;
    max-width: 400px;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-premium);
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    transform: translateY(30px);
    transition: transform var(--transition-base);
}

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

/* Mobile Bottom Sheet Transformation */
@media (max-width: 480px) {
    .auth-modal-overlay {
        align-items: flex-end;
        /* Align to bottom */
    }

    .auth-card {
        width: 100%;
        max-width: 100%;
        border-radius: var(--radius-app) var(--radius-app) 0 0;
        transform: translateY(100%);
        padding: var(--space-6) var(--space-4) var(--space-8);
        margin: 0;
        border-bottom: none;
        border-left: none;
        border-right: none;
    }


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


/* Close Button */
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--color-error);
    background: rgba(0, 0, 0, 0.05);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 700;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    text-align: center;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    padding-right: 4px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #f8fafc;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

.submit-btn {
    background: #4f46e5;
    background: var(--accent-gradient, linear-gradient(135deg, #4f46e5, #4338ca));
    color: white;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(67, 97, 238, 0.3);
}

.error-text {
    color: #ef4444;
    font-size: 0.8rem;
    display: none;
}

.form-group.error .error-text {
    display: block;
}

.form-group.error .form-input {
    border-color: #ef4444;
}

/* Google Button specifically in modal */
.google-auth-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

/* --- Device Lock Extras --- */
.icon-circle {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.google-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

/* Spinner */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

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

.submit-btn.loading .btn-text {
    display: none;
}

.submit-btn.loading .spinner {
    display: block;
}

/* --- Google Auth Styles --- */
.google-auth-container {
    padding: 0 5px;
    /* Aligned with form groups */
    margin-bottom: 20px;
}

.google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 500;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.google-btn:hover {
    background: #f8fafc;
    border-color: var(--primary-200);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.google-btn img {
    width: 18px;
    height: 18px;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-light);
}

.auth-divider span {
    padding: 0 15px;
}

#register-fields-email-pass.hidden {
    display: none;
}