/*
 * Auth pages — login / registrace (sdílený vizuální jazyk).
 * Napojeno na produktové --indigo z tokens.css (ne oddělená teal paleta).
 */

:root {
    /* Vždy tmavý ink na světlé kartě — nezávislé na dark landing tématu */
    --auth-ink: #0f172a;
    --auth-muted: #475569;
    --auth-accent: var(--color-primary-indigo, #3A2E7A);
    --auth-accent-deep: #2d2460;
    --auth-accent-soft: var(--indigo-soft, rgba(76, 224, 195, 0.14));
    --auth-card: #ffffff;
    --auth-line: #c7d2fe;
    --auth-danger: #be123c;
    --auth-radius: 1.25rem;
    --auth-font: var(--font-sans, "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body.auth-page {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    font-family: var(--auth-font);
    color: #0f172a;
    background:
        radial-gradient(ellipse 80% 60% at 10% 15%, rgba(58, 46, 122, 0.16), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 85%, rgba(76, 224, 195, 0.14), transparent 50%),
        linear-gradient(155deg, #eef2ff 0%, #f8fafc 42%, #e2e8f0 100%);
}

.auth-shell {
    width: min(100%, 26.5rem);
    position: relative;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 1.1rem;
    text-decoration: none;
    color: var(--auth-ink);
    font-weight: 800;
    letter-spacing: -0.03em;
    font-size: 1.15rem;
}

.auth-brand-mark {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.7rem;
    background: linear-gradient(145deg, #818cf8, var(--auth-accent-deep));
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.28);
}

.auth-card {
    background: var(--auth-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: calc(var(--auth-radius) + 0.35rem);
    box-shadow:
        0 24px 50px rgba(15, 23, 42, 0.12),
        0 2px 0 rgba(255, 255, 255, 0.65) inset;
    padding: 1.65rem 1.45rem 1.4rem;
}

.auth-card h1 {
    margin: 0 0 0.35rem;
    font-size: 1.55rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.auth-lead {
    margin: 0 0 1.25rem;
    color: var(--auth-muted);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.45;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.auth-field label {
    display: block;
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.01em;
}

.auth-field input,
.auth-field select {
    width: 100%;
    border: 1px solid var(--auth-line);
    border-radius: 0.85rem;
    background: #fff;
    padding: 0.78rem 0.9rem;
    font: inherit;
    font-weight: 600;
    color: var(--auth-ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input:focus,
.auth-field select:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.22);
}

.auth-field-error {
    display: none;
    margin: 0.35rem 0 0;
    color: var(--auth-danger);
    font-size: 0.78rem;
    font-weight: 700;
}

.auth-field-error.is-visible { display: block; }

.auth-status {
    display: none;
    margin: 0;
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.82rem;
    font-weight: 700;
}

.auth-status.is-visible { display: block; }
.auth-status.is-ok {
    background: #ecfdf5;
    color: #047857;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.25rem;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 2.85rem;
    border-radius: 0.9rem;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.auth-btn:hover { transform: translateY(-1px); }

.auth-btn--primary {
    background: var(--brand-gradient-cta, linear-gradient(135deg, #4f46e5, #f59e0b));
    color: #fff;
    box-shadow: 0 12px 24px rgba(245, 158, 11, 0.28);
}

.auth-btn--primary:hover,
.auth-btn--primary:focus-visible {
    filter: brightness(1.05);
    outline: none;
}

.auth-btn--ghost {
    background: transparent;
    color: var(--auth-accent-deep);
    border-color: transparent;
    font-weight: 700;
    min-height: 2.35rem;
}

.auth-btn--ghost:hover,
.auth-btn--ghost:focus-visible {
    background: var(--auth-accent-soft);
    outline: none;
}

.auth-btn--social {
    background: #fff;
    border-color: #cbd5e1;
    color: var(--auth-ink);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
}

.auth-btn--social:hover,
.auth-btn--social:focus-visible {
    border-color: #94a3b8;
    outline: none;
}

.auth-provider-icon {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.15rem 0;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.auth-footer {
    margin: 1.1rem 0 0;
    text-align: center;
    color: var(--auth-muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.auth-footer a {
    color: var(--auth-accent-deep);
    font-weight: 800;
    text-decoration: none;
}

.auth-footer a:hover,
.auth-footer a:focus-visible {
    text-decoration: underline;
    outline: none;
}

.auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 520px) {
    .auth-grid-2 { grid-template-columns: 1fr; }
    .auth-card { padding: 1.35rem 1.1rem 1.2rem; }
}

/* --- SPA auth (#/login, #/registrace) — Airbnb-like card + social --- */
.spa-auth {
    max-width: 28rem;
    margin: 2.25rem auto 3rem;
    padding: 0 1rem;
}

.spa-auth-card {
    background: #fff;
    color: #0f172a !important;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow:
        0 16px 40px rgba(15, 23, 42, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    padding: 1.85rem 1.6rem 1.5rem;
}

.spa-auth-card h1 {
    margin: 0 0 0.4rem;
    font-size: 1.65rem;
    letter-spacing: -0.03em;
    color: #0f172a !important;
}

.spa-auth-card .spa-auth-lead {
    color: #64748b !important;
}

.spa-auth-card .spa-auth-form label {
    color: #334155 !important;
}

.spa-auth-card .spa-auth-form input {
    background: #fff !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.75rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.spa-auth-card .spa-auth-form input::placeholder {
    color: #94a3b8 !important;
    opacity: 1;
}

.spa-auth-card .spa-auth-form input:hover {
    border-color: #c7d2fe !important;
}

.spa-auth-card .spa-auth-form input:focus {
    outline: none;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22) !important;
}

.spa-auth-card .spa-auth-footer,
.spa-auth-card .spa-auth-footer a,
.spa-auth-card .spa-auth-legal,
.spa-auth-card .spa-auth-legal a {
    color: #334155 !important;
}

.spa-auth-card .spa-auth-divider {
    color: #64748b !important;
}

.spa-auth-card .spa-password-toggle {
    color: #334155 !important;
}

.spa-auth-card .cta-btn--primary {
    transition: transform 0.15s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.spa-auth-card .cta-btn--primary:hover:not(:disabled),
.spa-auth-card .cta-btn--primary:focus-visible {
    filter: brightness(1.03);
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

.spa-auth-divider {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1.35rem 0 1.1rem;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
}

.spa-auth-divider::before,
.spa-auth-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: #e2e8f0;
}

.spa-auth-divider span {
    flex: 0 0 auto;
    white-space: nowrap;
}

.spa-auth-social {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.spa-auth-social-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    min-height: 3rem;
    padding: 0.7rem 1rem;
    border-radius: 0.85rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.spa-auth-social-btn:disabled {
    opacity: 0.72;
    cursor: wait;
}

.spa-auth-social-btn--google {
    background: #fff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.spa-auth-social-btn--google:hover:not(:disabled),
.spa-auth-social-btn--google:focus-visible {
    border-color: #c7d2fe;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18), 0 8px 20px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
    outline: none;
}

.spa-auth-social-btn--apple {
    background: #0f172a;
    color: #fff;
    border: 1px solid #0f172a;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
}

.spa-auth-social-btn--apple:hover:not(:disabled),
.spa-auth-social-btn--apple:focus-visible {
    background: #1e293b;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22), 0 10px 24px rgba(15, 23, 42, 0.28);
    transform: translateY(-1px);
    outline: none;
}

.spa-auth-social-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
}

.spa-auth-social-label {
    flex: 0 1 auto;
}

.spa-auth-spinner {
    display: none;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 999px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: spa-auth-spin 0.7s linear infinite;
}

.spa-auth-social-btn.is-loading .spa-auth-spinner {
    display: inline-block;
}

.spa-auth-social-btn.is-loading .spa-auth-social-icon,
.spa-auth-social-btn.is-loading .spa-auth-social-label {
    opacity: 0.35;
}

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

/* Dark canvas: karta zůstává bílá (dark-white-surfaces) */
html[data-theme="dark"] .spa-auth-card,
html[data-theme="dark"] .spa-auth-card h1,
html[data-theme="dark"] .spa-auth-card .spa-auth-lead,
html[data-theme="dark"] .spa-auth-card .spa-auth-form label,
html[data-theme="dark"] .spa-auth-card .spa-auth-footer,
html[data-theme="dark"] .spa-auth-card .spa-auth-footer a {
    color: inherit;
}

html[data-theme="dark"] .spa-auth-card {
    color: #0f172a;
}

html[data-theme="dark"] .spa-auth-card .spa-auth-lead {
    color: #64748b;
}

html[data-theme="dark"] .spa-auth-card .spa-auth-form label {
    color: #334155;
}

html[data-theme="dark"] .spa-auth-card .spa-auth-footer,
html[data-theme="dark"] .spa-auth-card .spa-auth-footer a {
    color: #475569;
}

@media (max-width: 767.98px) {
    .spa-auth {
        margin-top: 1.25rem;
    }
    .spa-auth-card {
        padding: 1.45rem 1.15rem 1.25rem;
        border-radius: 0.9rem;
    }
}
