/**
 * Member auth shell (login, register, recovery, verify resend).
 * Scoped to .auth-page-shell so layouts.simple pages without it are unchanged.
 * Tokens aligned with legacy CardPlusPlay modern auth cards (views/login, signup, recovery).
 *
 * Served from public/ so /login works without npm run build (no Vite manifest required).
 */

.auth-page-shell {
    --auth-primary: #6366f1;
    --auth-primary-dark: #4f46e5;
    --auth-gradient-start: #667eea;
    --auth-gradient-end: #764ba2;
    --auth-card-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    --auth-card-border: 1px solid rgba(255, 255, 255, 0.2);
    --auth-text: #18181b;
    --auth-muted: #6b7280;
    width: 100%;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    box-sizing: border-box;
}

/* Page chrome when member auth shell is present */
body:has(main .auth-page-shell) {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    background-attachment: fixed;
}

body:has(main .auth-page-shell)::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(120, 119, 198, 0.08) 0%, transparent 50%);
}

body main:has(.auth-page-shell) {
    max-width: min(440px, 100%);
    width: 100%;
}

/* Card surface: matches legacy “modern” auth card until Phase 3+ replaces inline .card rules */
.auth-page-shell .auth-card-surface,
.auth-page-shell .card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: var(--auth-card-shadow);
    border: var(--auth-card-border);
    padding: 2rem;
}

/* -------------------------------------------------------------------------- */
/* Member login (Phase 3) — scoped to .member-login-page                     */
/* -------------------------------------------------------------------------- */

.member-login-page .auth-login-header {
    text-align: center;
    margin-bottom: 1.75rem;
    position: relative;
}

.member-login-page .auth-login-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 5.5rem;
    height: 5.5rem;
    min-width: 88px;
    min-height: 88px;
    background: linear-gradient(135deg, var(--auth-gradient-start), var(--auth-gradient-end));
    border-radius: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.member-login-page .auth-login-logo-link:hover {
    transform: scale(1.04);
    box-shadow: 0 12px 25px rgba(99, 102, 241, 0.35);
}

.member-login-page .auth-login-logo-link img {
    width: 3.25rem;
    height: 3.25rem;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.member-login-page .auth-login-logo-fallback {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-align: center;
    padding: 0 0.5rem;
}

.member-login-page .auth-login-title {
    margin: 0 0 0.35rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.member-login-page .auth-login-subtitle {
    margin: 0;
    font-size: 1.05rem;
    color: var(--auth-muted);
    font-weight: 400;
}

.member-login-page .auth-alert {
    border-radius: 16px;
    padding: 14px 18px;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.45;
    border: none;
}

.member-login-page .auth-alert--success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border-inline-start: 4px solid #10b981;
}

.member-login-page .auth-alert--error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-inline-start: 4px solid #ef4444;
}

.member-login-page .auth-alert--warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border-inline-start: 4px solid #f59e0b;
}

.member-login-page .auth-field {
    margin-bottom: 1.15rem;
}

.member-login-page .auth-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.member-login-page .auth-input-wrap {
    position: relative;
}

.member-login-page .auth-input-icon {
    position: absolute;
    inset-inline-start: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.member-login-page .auth-input {
    width: 100%;
    box-sizing: border-box;
    padding-block: 14px;
    padding-inline-start: 48px;
    padding-inline-end: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    font-size: 0.9375rem;
    color: #1f2937;
    background: #f9fafb;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.member-login-page .auth-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.member-login-page .auth-input-wrap--password .auth-input {
    padding-inline-end: 48px; /* room for eye toggle */
}

.member-login-page .auth-password-toggle {
    position: absolute;
    inset-inline-end: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 6px;
    z-index: 2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.member-login-page .auth-password-toggle:hover {
    color: var(--auth-primary);
}

.member-login-page .auth-forgot {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.member-login-page .auth-forgot:hover {
    color: var(--auth-primary-dark);
}

.member-login-page .auth-remember {
    margin-bottom: 1rem;
}

.member-login-page .auth-remember-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    line-height: 1.35;
}

.member-login-page .auth-remember-input {
    margin-top: 0.2rem;
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--auth-primary);
    flex-shrink: 0;
}

.member-login-page .auth-remember-hint {
    margin: 0.4rem 0 0;
    padding-inline-start: 1.65rem;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--auth-muted);
}

.member-login-page .auth-submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 16px 18px;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--auth-gradient-start), var(--auth-gradient-end));
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.member-login-page .auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.4);
}

.member-login-page .auth-submit:active {
    transform: translateY(0);
}

.member-login-page .auth-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: var(--auth-muted);
}

.member-login-page .auth-links a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
}

.member-login-page .auth-links a:hover {
    color: var(--auth-primary-dark);
    background: rgba(99, 102, 241, 0.08);
}

.member-login-page .auth-links-sep {
    color: #d1d5db;
    margin: 0 0.2rem;
    user-select: none;
}

/* Register (Phase 4): shares .member-login-page field + button styles */
.auth-register-page .auth-terms {
    margin: 0 0 1.15rem;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--auth-muted);
    text-align: center;
}

.auth-register-page .auth-terms a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-register-page .auth-terms a:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

/* Social login (Phase 7): gated in Blade; `data-member-social-login` for tests */
.member-login-page .auth-social-block {
    margin-bottom: 1.25rem;
}

.member-login-page .auth-social-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--auth-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.member-login-page .auth-social-divider::before,
.member-login-page .auth-social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.member-login-page .auth-social-divider span {
    flex-shrink: 0;
}

.member-login-page .auth-social-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 18px;
    border-radius: 14px;
    border: 2px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.member-login-page .auth-social-google:hover {
    border-color: #d1d5db;
    background: #f9fafb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    color: #1f2937;
}

.member-login-page .auth-social-google-icon {
    font-size: 1.15rem;
    color: #4285f4;
}

/* Recovery request + reset (Phase 5): reuse .member-login-page; hooks .auth-recovery-request-page / .auth-recovery-reset-page for tests */
/* Resend verification (GET /verify-email): .auth-verify-resend-page — same field styles as login/recovery */
