/**
 * Fiscalia Design System - Auth Layout
 * Layout shell for authentication pages
 *
 * Pages: /login, /signup, /forgot-password, /reset-password
 */

/* ============================================
   AUTH LAYOUT SHELL
   ============================================ */
.layout-auth,
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    gap: var(--space-lg);
    background: var(--bg-sidebar);
}

/* ============================================
   AUTH LOGO
   ============================================ */
.auth-logo,
.layout-auth .logo,
.auth-page .logo {
    font-family: var(--font-logo) !important;
    font-size: 2.5rem;
    font-weight: var(--font-bold);
    text-align: center;
    color: var(--logo-color);
    text-decoration: none;
}

.auth-logo:hover {
    color: var(--logo-color);
    text-decoration: none;
}

/* ============================================
   AUTH CONTAINER
   ============================================ */
.auth-container {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
}

/* ============================================
   AUTH HEADER
   ============================================ */
.auth-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.auth-title {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

/* ============================================
   AUTH FORM
   ============================================ */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.auth-form .form-group {
    margin-bottom: 0;
}

.auth-form .btn {
    width: 100%;
    margin-top: var(--space-xs);
}

/* ============================================
   AUTH LINKS
   ============================================ */
.auth-links,
.links {
    margin-top: var(--space-md);
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.auth-links a,
.links a {
    color: var(--teal-mid);
    font-weight: var(--font-medium);
    text-decoration: none;
}

.auth-links a:hover,
.links a:hover {
    color: var(--teal-deep);
}

/* ============================================
   AUTH DIVIDER
   ============================================ */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-md) 0;
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

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

/* ============================================
   SOCIAL AUTH BUTTONS
   ============================================ */
.social-auth {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.social-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.social-auth-btn:hover {
    background: var(--bg-input);
    border-color: var(--border-hover);
}

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

/* ============================================
   AUTH FOOTER
   ============================================ */
.auth-footer {
    margin-top: var(--space-lg);
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.auth-footer a {
    color: var(--text-tertiary);
}

/* ============================================
   PASSWORD STRENGTH METER
   ============================================ */
.password-strength {
    margin-top: 0.5rem;
}

.password-strength-bar {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    transition: width 0.3s, background 0.3s;
}

.password-strength-fill.weak { width: 33%; background: var(--error); }
.password-strength-fill.medium { width: 66%; background: var(--warning); }
.password-strength-fill.strong { width: 100%; background: var(--success); }

.password-strength-text {
    font-size: var(--text-xs);
    margin-top: 0.25rem;
}

/* ============================================
   AUTH PAGE HEADING
   ============================================ */
.auth-container h1 {
    font-family: var(--font-body);
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-lg);
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-align: center;
}

/* ============================================
   AUTH FORM OVERRIDES
   Base form styles in components/forms.css
   Only auth-specific overrides here
   ============================================ */

/* Password field needs padding for toggle button */
.auth-container input[type="password"] {
    padding-right: 60px;
}

/* Auth buttons are full-width primary style */
.auth-container button[type="submit"] {
    width: 100%;
    padding: 0.875rem;
    background: var(--teal-mid);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-xs);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: background 0.2s;
}

.auth-container button[type="submit"]:hover {
    background: var(--teal-deep);
}

.auth-container button[type="submit"]:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
}

/* ============================================
   MESSAGE ALERTS
   ============================================ */
.auth-container .error {
    background: var(--error);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-xs);
    margin-bottom: 1rem;
    font-size: var(--text-sm);
    display: none;
}

.auth-container .error.show {
    display: block;
}

.auth-container .success {
    background: var(--success);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-xs);
    margin-bottom: 1rem;
    font-size: var(--text-sm);
    display: none;
}

.auth-container .success.show {
    display: block;
}

/* ============================================
   PASSWORD TOGGLE
   ============================================ */
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    color: var(--text-secondary);
    border-radius: var(--radius-xs);
    transition: color 0.2s, background 0.2s;
}

.password-toggle:hover {
    color: var(--teal-mid);
    background: var(--bg-input);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   PASSWORD REQUIREMENTS
   ============================================ */
.password-hint {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.password-requirements {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: var(--radius-xs);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

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

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

.requirement-met {
    color: var(--success);
}

/* ============================================
   PLAN SELECTOR (SIGNUP)
   ============================================ */
.plan-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.plan-option {
    position: relative;
}

.plan-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.plan-option label {
    display: block;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
    height: 100%;
}

.plan-option input[type="radio"]:checked + label {
    border-color: var(--teal-mid);
    background: rgba(74, 128, 124, 0.05);
}

[data-theme="dark"] .plan-option input[type="radio"]:checked + label {
    background: rgba(74, 128, 124, 0.15);
}

.plan-option label:hover {
    border-color: var(--border-hover);
}

.plan-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.plan-name {
    font-weight: var(--font-bold);
    font-size: 1.125rem;
    color: var(--text-primary);
}

.plan-badge-pro {
    display: inline-block;
    padding: 2px 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.625rem;
    font-weight: var(--font-bold);
    text-transform: uppercase;
    border-radius: 4px;
    letter-spacing: 0.05em;
    width: fit-content;
}

.plan-price {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--teal-mid);
}

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

.plan-features li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.plan-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: var(--font-bold);
}

.plan-note {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-align: center;
    margin: 0.5rem 0 0 0;
}

/* ============================================
   TEXT DIVIDER
   ============================================ */
.divider {
    margin: 0.75rem 0;
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 600px) {
    .plan-selector {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: var(--space-lg);
        margin: var(--space-sm);
    }

    .auth-logo {
        font-size: 2rem;
    }
}
