:root {
    /*
     * color-scheme rekne prohlizeci, ze stranka je svetla - podle nej se ridi
     * scrollbary, vychozi podklad a nativni prvky formularu.
     */
    color-scheme: light;
    accent-color: #60a000;

    /*
     * Paleta i typografie vychazi z agrofabicovic.cz: zelena #60A000 se svetlejsim
     * doplnkem #95C700, temer cerna #0c0c0c v hero sekci a paticce, svetla plocha
     * #f9f9f9. Nadpisy tam bezi v Raleway 900 verzalkami s prostrkanim 2px.
     */
    --brand: #60a000;
    --brand-bright: #95c700;
    --brand-dark: #4d8000;
    --brand-deep: #3f6e00;

    --black: #0c0c0c;
    --page: #f9f9f9;
    --surface: #fff;
    --line: #dcdcdc;
    --ink: #1d1d1d;
    --ink-soft: #3d3d3d;
    --muted: #6b6b6b;

    --danger: #a32b23;
    --danger-bg: #fdf3f2;
    --danger-line: #f0d0cd;
    --warn: #8a6100;

    --font-display: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* Web ma v inputech a beznem textu systemovy font, Raleway drzi jen na nadpisech. */
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body.auth-body {
    margin: 0;
    background-color: var(--page);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(149, 199, 0, 0.35);
}

/* Rozvrzeni - vlevo tmavy brandovy panel, vpravo formular */

.auth-layout {
    display: grid;
    grid-template-columns: minmax(20rem, 32rem) 1fr;
    min-height: 100vh;
    min-height: 100svh;
}

.auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 3.25rem 3rem 2.25rem;
    background: var(--black);
    color: #fff;
}

/*
 * Dekorace panelu: zelene nasvetleni zdola, ztmaveni u horniho okraje a jemne
 * sikme linky pripominajici radky na poli.
 */
.auth-aside__pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(32rem 26rem at 114% 110%, rgba(96, 160, 0, 0.5), transparent 60%),
        radial-gradient(26rem 20rem at -8% -6%, rgba(149, 199, 0, 0.14), transparent 68%),
        repeating-linear-gradient(102deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 2.75rem);
}

/* Souvratove kruhy vlevo dole - dokresluji zemedelsky motiv, ale drzi se v pozadi. */
.auth-aside__pattern::after {
    content: "";
    position: absolute;
    left: -45%;
    bottom: -60%;
    width: 60rem;
    height: 60rem;
    border-radius: 50%;
    background: repeating-radial-gradient(circle, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 3.25rem);
    -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 72%);
    mask-image: radial-gradient(circle, #000 30%, transparent 72%);
}

.auth-aside__inner,
.auth-aside__foot {
    position: relative;
    z-index: 1;
}

.auth-aside__brand {
    margin: 0;
    line-height: 1;
}

.auth-aside__logo {
    width: 12rem;
    height: auto;
}

.auth-aside__kicker {
    margin: 3.25rem 0 0.85rem;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--brand-bright);
}

.auth-aside__claim {
    max-width: 13ch;
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 2.7vw, 2.5rem);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.auth-aside__claim::after {
    content: "";
    display: block;
    width: 3.5rem;
    height: 3px;
    margin-top: 1.5rem;
    background: var(--brand);
}

.auth-aside__points {
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.9rem;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.auth-aside__points li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-aside__points .mdi {
    flex: 0 0 auto;
    font-size: 1.15rem;
    letter-spacing: normal;
    color: var(--brand-bright);
}

.auth-aside__foot {
    margin: 2.5rem 0 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
}

/* Sloupec s formularem */

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.auth-main__inner {
    width: 100%;
    max-width: 23.5rem;
}

.auth-head {
    margin-bottom: 1.85rem;
}

.auth-head__eyebrow {
    margin: 0 0 0.6rem;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--brand-deep);
}

.auth-head__title {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--black);
}

.auth-head__subtitle {
    margin: 0;
    font-size: 0.925rem;
    line-height: 1.55;
    color: var(--muted);
}

/* Hlaska z flash session */

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1.35rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--danger-line);
    border-left: 3px solid var(--danger);
    background: var(--danger-bg);
    color: var(--danger);
}

.auth-alert--info {
    border-color: #d9e8ab;
    border-left-color: var(--brand);
    background: #f5f9e9;
    color: var(--brand-deep);
}

.auth-alert__icon {
    flex: 0 0 auto;
    margin-top: 0.05rem;
    font-size: 1.1rem;
}

.auth-alert__text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    /* Viceradkove hlasky prichazi z flash session oddelene znakem noveho radku. */
    white-space: pre-line;
}

/* Pole formulare */

.auth-field {
    margin-bottom: 1.05rem;
}

.auth-field__label {
    display: block;
    margin-bottom: 0.4rem;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.auth-field__wrap {
    position: relative;
}

.auth-field__input {
    width: 100%;
    height: 3rem;
    padding: 0 0.9rem;
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.2;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.auth-field__input--password {
    padding-right: 3rem;
}

.auth-field__input:hover {
    border-color: #bdbdbd;
}

.auth-field__input:focus {
    outline: 0;
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem rgba(96, 160, 0, 0.2);
}

.auth-field__toggle {
    position: absolute;
    top: 50%;
    right: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.auth-field__toggle:hover {
    background: rgba(12, 12, 12, 0.06);
    color: var(--black);
}

.auth-field__toggle:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(96, 160, 0, 0.3);
    color: var(--black);
}

.auth-field__hint {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.4rem 0 0;
    font-size: 0.78rem;
    color: var(--warn);
}

.auth-field__hint[hidden] {
    display: none;
}

/* Zaskrtavatko */

.auth-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.5rem 0 1.5rem;
    cursor: pointer;
    user-select: none;
}

/*
 * Nativni checkbox zustava v DOM kvuli klavesnici a odesilani formulare,
 * videt je misto nej .auth-check__box.
 */
.auth-check__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.auth-check__box {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 1.15rem;
    height: 1.15rem;
    border: 1px solid #c4c4c4;
    background: var(--surface);
    color: transparent;
    font-size: 0.8rem;
    line-height: 1;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.auth-check__input:checked + .auth-check__box {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.auth-check__input:focus-visible + .auth-check__box {
    box-shadow: 0 0 0 0.2rem rgba(96, 160, 0, 0.3);
}

.auth-check__label {
    font-size: 0.875rem;
    color: var(--ink-soft);
}

/* Odesilaci tlacitko - hranate, verzalky s prostrkanim, jako tlacitka na webu firmy */

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    width: 100%;
    height: 3.4rem;
    padding: 0 1.25rem;
    border: 0;
    border-radius: 0;
    background: var(--brand);
    color: #fff;
    font-family: var(--font-display);
    /*
     * 1.2rem/700 verzalkami odpovida "velkemu textu" podle WCAG, takze bily text
     * na firemni zelene projde kontrastem 3:1. Mensi rez by uz nestacil.
     */
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 3px;
    line-height: 1.2;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.auth-submit:hover {
    background: var(--brand-dark);
}

.auth-submit:active {
    background: var(--brand-deep);
}

.auth-submit:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.2rem #fff, 0 0 0 0.4rem var(--brand);
}

.auth-submit__icon {
    font-size: 1.2rem;
    letter-spacing: normal;
    transition: transform 0.15s ease-in-out;
}

.auth-submit:hover .auth-submit__icon {
    transform: translateX(0.2rem);
}

.auth-submit__spinner {
    display: none;
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.6s linear infinite;
}

.auth-submit.is-loading {
    pointer-events: none;
    background: var(--brand-dark);
}

.auth-submit.is-loading .auth-submit__spinner {
    display: block;
}

.auth-submit.is-loading .auth-submit__icon {
    display: none;
}

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

.auth-note {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 1.85rem 0 0;
    padding-top: 1.35rem;
    border-top: 1px solid var(--line);
    font-size: 0.8rem;
    color: var(--muted);
}

/* Uzky displej - z panelu zustane jen tmavy pruh s logem */

@media (max-width: 64rem) {
    .auth-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .auth-aside {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 1.25rem 1.5rem;
    }

    .auth-aside__pattern::after {
        display: none;
    }

    .auth-aside__logo {
        width: 9.5rem;
    }

    .auth-aside__kicker,
    .auth-aside__claim,
    .auth-aside__points {
        display: none;
    }

    .auth-aside__foot {
        margin: 0;
        text-align: right;
    }

    .auth-main {
        align-items: flex-start;
        padding: 2.5rem 1.25rem 3rem;
    }
}

@media (max-width: 30rem) {
    .auth-aside__foot {
        display: none;
    }

    /* Velikost pisma zustava kvuli kontrastu, ubira se jen prostrkani. */
    .auth-submit {
        letter-spacing: 1.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-field__input,
    .auth-field__toggle,
    .auth-check__box,
    .auth-submit,
    .auth-submit__icon {
        transition: none;
    }

    .auth-submit:hover .auth-submit__icon {
        transform: none;
    }

    .auth-submit__spinner {
        animation-duration: 2s;
    }
}
