/* ------------------------------------------------------------------
   Lina auth pages (login, forgot password).

   app.css is a prebuilt Midone artifact with no source in this repo, so its
   Tailwind utilities cannot be extended - only classes already compiled into it
   exist. These pages therefore carry their own stylesheet, the same way
   resetpassword.css and email-verification.css do.

   app.css loads first and declares the --color-* palette on :root; everything
   below reuses it so the page can never drift from the theme.
   ------------------------------------------------------------------ */

.auth {
    margin: 0;
    min-height: 100vh;
    background-color: rgb(var(--color-slate-100));
}

.auth__grid {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
}

/* ---------------- hero (desktop only) ---------------- */

/* hidden rather than stacked on small screens: the photo is a tall portrait and
   would push the form below the fold on a phone. */
.auth__hero {
    display: none;
}

.auth__hero-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* keep the student's face in frame as the column narrows. */
    object-position: 50% 15%;
}

/* the photo's own backdrop is pale, so the copy needs a scrim to stay legible.
   Transparent at the top keeps the student visible; brand blue deepens into
   near-slate-900 behind the text. */
.auth__hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgb(var(--color-primary) / 0.05) 0%,
        rgb(var(--color-primary) / 0.35) 45%,
        rgb(var(--color-slate-900) / 0.92) 100%
    );
}

.auth__hero-content {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 2.5rem;
}

.auth__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    align-self: flex-start;
    color: #fff;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
}

.auth__brand img {
    width: 1.75rem;
}

.auth__hero-copy {
    margin-top: auto;
    max-width: 30rem;
    color: #fff;
}

.auth__hero-copy h1 {
    margin: 0 0 0.75rem;
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.auth__hero-copy p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: rgb(255 255 255 / 0.8);
}

@media (min-width: 1024px) {
    .auth__grid {
        grid-template-columns: 1.1fr 1fr;
    }

    .auth__hero {
        position: relative;
        display: block;
        overflow: hidden;
        background-color: rgb(var(--color-primary));
    }
}

/* ---------------- form panel ---------------- */

.auth__panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.auth__card {
    width: 100%;
    max-width: 26rem;
    padding: 2rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 10px 30px rgb(var(--color-slate-900) / 0.08),
                0 1px 2px rgb(var(--color-slate-900) / 0.04);
}

/* the hero already carries the brand on desktop. */
.auth__mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.75rem;
    color: rgb(var(--color-primary));
    font-size: 1.125rem;
    font-weight: 700;
    text-decoration: none;
}

.auth__mobile-brand img {
    width: 1.625rem;
}

@media (min-width: 1024px) {
    .auth__mobile-brand {
        display: none;
    }
}

.auth__title {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: rgb(var(--color-slate-900));
}

.auth__subtitle {
    margin: 0 0 1.75rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: rgb(var(--color-slate-500));
}

/* ---------------- fields ---------------- */

.auth__field {
    margin-bottom: 1.125rem;
}

.auth__label {
    display: block;
    margin-bottom: 0.4375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgb(var(--color-slate-700));
}

.auth__input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 0.875rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: rgb(var(--color-slate-900));
    background: #fff;
    border: 1px solid rgb(var(--color-slate-300));
    border-radius: 0.625rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth__input::placeholder {
    color: rgb(var(--color-slate-400));
}

.auth__input:focus {
    outline: none;
    border-color: rgb(var(--color-primary));
    box-shadow: 0 0 0 3px rgb(var(--color-primary) / 0.15);
}

.auth__password {
    position: relative;
}

/* keep typed text clear of the toggle. */
.auth__password .auth__input {
    padding-right: 2.75rem;
}

.auth__toggle {
    position: absolute;
    top: 50%;
    right: 0.625rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: rgb(var(--color-slate-400));
    background: transparent;
    border: 0;
    border-radius: 0.375rem;
    cursor: pointer;
}

.auth__toggle:hover {
    color: rgb(var(--color-slate-600));
}

.auth__toggle:focus-visible {
    outline: 2px solid rgb(var(--color-primary));
    outline-offset: 2px;
}

.auth__toggle svg {
    width: 1.125rem;
    height: 1.125rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------------- row, button, footer ---------------- */

.auth__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.25rem 0 1.5rem;
}

.auth__check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: rgb(var(--color-slate-600));
    cursor: pointer;
    user-select: none;
}

.auth__check input {
    width: 1rem;
    height: 1rem;
    accent-color: rgb(var(--color-primary));
    cursor: pointer;
}

.auth__link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgb(var(--color-primary));
    text-decoration: none;
    white-space: nowrap;
}

.auth__link:hover {
    text-decoration: underline;
}

.auth__submit {
    display: block;
    width: 100%;
    padding: 0.8125rem 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: rgb(var(--color-primary));
    border: 0;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease;
}

.auth__submit:hover {
    background: rgb(var(--color-primary) / 0.9);
}

.auth__submit:active {
    transform: translateY(1px);
}

.auth__submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.auth__foot {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.8125rem;
    color: rgb(var(--color-slate-500));
}

.auth__foot a {
    font-weight: 600;
    color: rgb(var(--color-primary));
    text-decoration: none;
}

.auth__foot a:hover {
    text-decoration: underline;
}

/* ---------------- validation ----------------
   The tag helpers always emit these elements and swap the class between the
   -valid and -error variants, so the empty state has to be hidden explicitly or
   it reserves blank space above the form. */

.auth__summary {
    margin-bottom: 1.25rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid rgb(var(--color-danger) / 0.2);
    border-radius: 0.625rem;
    background: rgb(var(--color-danger) / 0.08);
}

.auth__summary ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth__summary li {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: rgb(var(--color-danger));
}

.auth__summary.validation-summary-valid {
    display: none;
}

.auth__error {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: rgb(var(--color-danger));
}

.auth__error:empty {
    display: none;
}
