/* =============================================================================
   Auth pages — Login, Register, Logout, AccessDenied
   Split-screen design: brand panel on the left, form on the right.
   ========================================================================== */

/* The auth pages share the app's visual foundation: every value resolves through the
   design tokens (tokens.css, loaded first by _LayoutAuth) so the login/register/account
   pages use the same palette, radius and elevation as the Blazor app — no separate
   auth brand color. The --auth-* aliases are kept so the existing markup is unchanged. */
:root {
    --auth-primary: var(--color-primary);
    --auth-primary-hover: #17497f;     /* one step darker than --color-primary for :hover */
    --auth-accent: var(--color-ring);
    --auth-bg: var(--color-background);
    --auth-text: var(--color-text);
    --auth-muted: var(--color-text-muted);
    --auth-border: var(--color-border);
    --auth-danger: var(--color-error);
    --auth-shadow: var(--elevation-1), var(--elevation-2);
}

/* The `*` box-sizing reset and the body box used to live here. Because this sheet
   loads app-wide, the AUTH stylesheet was in effect the application's reset — it
   only looked local. Both moved to base.css (US 6958), which every layout loads;
   body's `min-height: 100vh` went with them as redundant, since .auth-page and
   .auth-center each set their own. */

/* ---- Layout ---- */
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 5fr 6fr;
}

/* ---- Left panel: brand ---- */
.auth-brand {
    /* Two soft lights over a deep navy, in the mark's own colours: the panel should read as the
       logo's background, not as a stock blue gradient. */
    background:
        radial-gradient(ellipse 80% 60% at 15% 10%, rgba(122, 163, 214, 0.35) 0%, transparent 60%),
        radial-gradient(ellipse 70% 70% at 85% 90%, rgba(122, 163, 214, 0.18) 0%, transparent 60%),
        linear-gradient(160deg, #1d3557 0%, #142743 55%, #0f1f36 100%);
    color: #fff;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 36px 36px;
    transform: rotate(15deg);
    pointer-events: none;
}

.auth-brand__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
}

.auth-brand__logo-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(8, 20, 38, 0.35);
}

.auth-brand__logo-mark img {
    display: block;
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.auth-brand__content {
    position: relative;
    z-index: 1;
    max-width: 480px;
}

.auth-brand__headline {
    font-size: clamp(2.25rem, 2.6vw + 1rem, 3rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin: 0 0 1.25rem 0;
    text-wrap: balance;
}

.auth-brand__tagline {
    font-size: 1rem;
    line-height: 1.65;
    opacity: 0.85;
    margin: 0 0 2rem 0;
}

.auth-brand__features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.875rem;
}

.auth-brand__features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    opacity: 0.9;
}

.auth-brand__features li::before {
    content: "";
    flex: 0 0 18px;
    height: 18px;
    border-radius: 50%;
    background:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%23fff' d='M6.173 11.5L2.5 7.827l1.327-1.327L6.173 8.846l5.5-5.5L13 4.673z'/></svg>") center / 14px no-repeat,
        rgba(255,255,255,0.18);
}

.auth-brand__footer {
    font-size: 0.8125rem;
    opacity: 0.65;
    position: relative;
    z-index: 1;
}

/* ---- Right panel: form ---- */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    /* A faint wash rather than flat white, so the card below has something to sit on. */
    background:
        radial-gradient(ellipse 90% 55% at 50% 0%, rgba(29, 53, 87, 0.05) 0%, transparent 70%),
        var(--auth-bg);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px -12px rgba(16, 24, 40, 0.18);
}

/* Shown only where the brand panel is not (see the media query at the foot of this block). */
.auth-card__mark {
    display: none;
    margin-bottom: 1.25rem;
}

.auth-card__mark img {
    display: block;
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.auth-card__header {
    margin-bottom: 1.75rem;
}

.auth-card__title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0 0 0.375rem 0;
}

.auth-card__subtitle {
    color: var(--auth-muted);
    font-size: 0.9375rem;
    margin: 0;
}

/* ---- Form fields ---- */
.auth-field {
    margin-bottom: 1.25rem;
}

.auth-field__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-text);
    margin-bottom: 0.5rem;
}

.auth-field__input {
    width: 100%;
    padding: 0.8125rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--auth-text);
    /* Very slightly off-white at rest, white on focus: the field you are in is the lit one. */
    background: #fbfcfe;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    font-family: inherit;
}

.auth-field__input:focus {
    outline: none;
    background: #fff;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(29, 95, 168, 0.15);
}

.auth-field__input::placeholder {
    color: #adb3c2;
}

.auth-field__hint {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--auth-muted);
}

.auth-field__error {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--auth-danger);
}

/* ---- Inline check (remember me) ---- */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1rem 0 1.75rem 0;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--auth-text);
    cursor: pointer;
    user-select: none;
}

.auth-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-accent);
    cursor: pointer;
}

/* ---- Buttons ---- */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: var(--auth-primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10), 0 8px 16px -10px rgba(29, 53, 87, 0.55);
    transition: background-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.auth-btn:hover {
    background: var(--auth-primary-hover);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10), 0 10px 20px -10px rgba(29, 53, 87, 0.65);
}

.auth-btn:active {
    transform: translateY(1px);
}

.auth-btn:focus-visible {
    outline: 2px solid var(--auth-accent);
    outline-offset: 2px;
}

/* ---- Error summary box ---- */
.auth-summary {
    background: #fdf2f2;
    border: 1px solid #fcd7d7;
    color: var(--auth-danger);
    padding: 0.75rem 0.9375rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.auth-summary:empty {
    display: none;
}

.auth-summary ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* ---- Footer link ---- */
.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--auth-muted);
}

.auth-footer a {
    color: var(--auth-accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ---- Centered single-card pages (Logout, AccessDenied) ---- */
.auth-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-center__card {
    background: #fff;
    border-radius: 12px;
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--auth-shadow);
}

.auth-center__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem auto;
    border-radius: 50%;
    background: rgba(29, 95, 168, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.auth-center__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.auth-center__text {
    color: var(--auth-muted);
    margin: 0 0 1.5rem 0;
}

/* =============================================================================
   Password show/hide toggle
   ========================================================================== */

.auth-field--password .auth-field__input {
    /* Misto pro tlacitko ikony vlevo */
    padding-left: 2.625rem;
}

.auth-password-toggle {
    position: absolute;
    left: 0.5rem;
    /* Vertikalne zarovnat se vstupem (input nema fixni vysku, ale 0.75rem padding + line-height) */
    top: 50%;
    transform: translateY(-50%);
    /* Po zobrazeni labelu nahore se vystredi spravne, protoze .auth-field--password
       je obal jen okolo input + tlacitka, ne okolo labelu. Viz markup nize. */
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--auth-muted);
    padding: 0;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.auth-password-toggle:hover {
    color: var(--auth-primary);
    background: rgba(29, 95, 168, 0.08);
}

.auth-password-toggle:focus-visible {
    outline: 2px solid var(--auth-accent);
    outline-offset: 2px;
    color: var(--auth-primary);
}

.auth-password-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* Ridime visibility ikon pres data-state na tlacitku */
.auth-password-toggle[data-state="hidden"] .icon-eye-shown,
.auth-password-toggle[data-state="shown"] .icon-eye-hidden {
    display: none;
}

/* Wrapper okolo input + tlacitka, aby tlacitko se vystrediilo vuci inputu, ne vuci celemu auth-field */
.auth-password-wrap {
    position: relative;
}

/* =============================================================================
   Auth language switcher (US 5272): pre-auth visitors pick the UI language
   ========================================================================== */

.auth-lang {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 10;
    display: flex;
    gap: 2px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--app-border, #e7e9ee);
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.auth-lang__item {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    color: #5a6473;
    text-decoration: none;
}

.auth-lang__item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #2d3a50;
}

.auth-lang__item--active {
    background: var(--color-primary);
    color: var(--color-primary-foreground);
}

.auth-lang__item:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}

/* ---- Narrow screens ---------------------------------------------------------------
   This block lives at the FOOT of the sheet on purpose. It used to sit near the top,
   above `.auth-brand { display: flex }` — same specificity, later rule wins, so the
   brand panel never actually hid on a phone and the form was pushed below a full
   screen of marketing copy. Keep responsive overrides last. */
@media (max-width: 900px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        display: none;
    }

    /* With the brand panel gone, the card carries the mark instead. */
    .auth-card__mark {
        display: block;
    }

    /* On a small screen the card is the whole page; a border around the whole page is noise. */
    .auth-card {
        padding: 2rem 1.5rem;
        border: none;
        box-shadow: none;
        background: transparent;
    }
}
