/**
 * Auth Pages Styles
 * Shared styles for login, forgot-password, reset-password, set-password pages
 */

/* ==================== Auth Layout ==================== */
body.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-secondary);
}

/* ==================== Auth Header (Old - deprecated) ==================== */
.auth-header {
    background: var(--color-bg-primary);
    border-bottom: 1px solid var(--color-border);
}

/* Hide public header for authenticated users on pages with sidebar navigation */
body.is-authenticated .public-header {
    display: none;
}

.auth-header-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

@media (min-width: 768px) {
    .auth-header-content {
        padding: var(--space-md) var(--space-md);
    }
}

@media (min-width: 1024px) {
    .auth-header-content {
        padding: var(--space-md) var(--space-lg);
    }
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 600;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.auth-logo-icon {
    width: 32px;
    height: 32px;
    color: var(--color-accent-primary);
}

.auth-nav {
    display: flex;
    gap: var(--space-md);
}

.auth-nav-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color var(--transition-base);
}

.auth-nav-link:hover {
    color: var(--color-text-primary);
}

.auth-nav-link.active {
    color: var(--color-accent-primary);
    font-weight: 500;
}

/* ==================== Auth Main Content ==================== */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-md);
}

/* ==================== Auth Card ==================== */
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
}

.auth-card-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.auth-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--space-xs);
}

.auth-card-subtitle {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
}

.auth-card-footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.auth-card-footer p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* ==================== Auth Links ==================== */
.auth-link {
    color: var(--color-accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-base);
}

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

/* ==================== Success State ==================== */
.auth-success-block {
    text-align: center;
    padding: var(--space-2xl) 0;
}

.auth-success-icon {
    width: 64px;
    height: 64px;
    color: var(--color-success);
    margin: 0 auto var(--space-md);
}

.auth-success-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-sm);
}

.auth-success-description {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

.auth-resend-text {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
}

.auth-resend-link {
    color: var(--color-accent-primary);
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.75rem;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .auth-main {
        padding: var(--space-lg) var(--space-md);
    }

    .auth-card {
        padding: var(--space-lg);
    }

    .auth-card-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .auth-nav {
        gap: var(--space-sm);
    }
    
    .auth-nav-link {
        font-size: 0.875rem;
    }
}

/* ==================== Guest/Auth Visibility ==================== */
/* Hide public header by default until auth status is determined */
.public-header {
    display: none !important;
}

/* Always show public header on landing page and auth pages */
body.copilot-landing .public-header,
body.auth-page .public-header {
    display: block !important;
}

/* Auth-only elements hidden for guests */
body.is-guest .auth-only {
    display: none !important;
}

/* Guest-only elements hidden for authenticated users */
body.is-authenticated .guest-only {
    display: none !important;
}

/* Hide sidebar for guests */
body.is-guest .app-sidebar {
    display: none !important;
}

/* Hide mobile footer nav for guests */
body.is-guest .app-mobile-footer {
    display: none !important;
}

/* Show public header for guests on dynamic pages */
body.is-guest .public-header {
    display: block !important;
}

/* Hide public header for authenticated users (they use sidebar nav) */
body.is-authenticated .public-header {
    display: none !important;
}

/* Exception: never hide on auth pages - they don't have sidebar */
body.auth-page.is-authenticated .public-header {
    display: block !important;
}

/* Adjust main content for guests (no sidebar) */
body.is-guest .app-main {
    margin-left: 0 !important;
}

/* Full width layout for guests */
body.is-guest .app-layout {
    grid-template-columns: 1fr !important;
}

/* Center content for guest pages */
body.is-guest .app-content {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==================== Guest Promo Section ==================== */
.guest-promo-section {
    background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    color: white;
    text-align: center;
    margin-top: var(--space-xl);
}

.guest-promo-section h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.guest-promo-section p {
    opacity: 0.9;
    margin-bottom: var(--space-lg);
}

.guest-promo-section .btn {
    background: white;
    color: #1e40af;
    font-weight: 600;
}

.guest-promo-section .btn:hover {
    background: #f0f0f0;
}

/* Alternative lighter promo style */
.guest-promo-section.light {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1e293b;
}

.guest-promo-section.light h3 {
    color: #1e293b;
}

.guest-promo-section.light p {
    color: #64748b;
    opacity: 1;
}

/* ==================== CTA Modal ==================== */
.cta-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.cta-modal.show {
    display: flex;
}

.cta-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 420px;
    width: 90%;
    padding: 32px;
    text-align: center;
    position: relative;
}

.cta-modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.cta-modal-content p {
    color: #64748b;
    margin-bottom: 24px;
}

.cta-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}
