/* ==========================================================================
   Life — global application styles
   Base typography, shared form and validation behaviour.
   ========================================================================== */

:root {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
form label {
    font-family: var(--lf-font);
}

.required-field {
    font-weight: 600;
    color: var(--lf-ink);
}

/* Make ASP.NET validation messages visible with Bootstrap styling */
.invalid-feedback.field-validation-error {
    display: block !important;
}

.invalid-feedback.field-validation-valid {
    display: none !important;
}

/* Style inputs with validation errors */
.input-validation-error {
    border-color: var(--lf-danger) !important;
}

    .input-validation-error:focus {
        border-color: var(--lf-danger) !important;
        box-shadow: var(--lf-ring-danger) !important;
    }

.input-validation-valid {
    border-color: var(--lf-success-border) !important;
}

/* --------------------------------------------------------------------------
   Flagged items: past their date, in the red group at the foot of a list.

   Two names because two different things are past their date. An expired
   licence or card is dead; an overdue eye test is not - the prescription is
   still your history, and what you owe is another appointment. The styling is
   the same either way, so both selectors share every rule below.
   -------------------------------------------------------------------------- */
.expired-items .list-group-item,
.overdue-items .list-group-item {
    background-color: #fdf5f5;
    border-color: var(--lf-danger-border);
}

    .expired-items .list-group-item:hover,
    .overdue-items .list-group-item:hover {
        border-color: var(--lf-danger);
    }

/* --------------------------------------------------------------------------
   Empty states
   -------------------------------------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    padding: 2.5rem 1.5rem;
    color: var(--lf-ink-muted);
}

    /* Only the leading illustration icon is scaled up. Nested icons (for
       example the plus in an "Add your first" button) keep the normal button
       icon size from .btn i rather than inheriting the 2rem. */
    .empty-state > i {
        font-size: 2rem;
        line-height: 1;
        color: var(--lf-border-strong);
    }

    .empty-state p {
        margin-bottom: 0;
        font-size: 0.9375rem;
    }

.empty-state-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--lf-ink);
}

/* --------------------------------------------------------------------------
   Brand

   Modern banking brands tend to drop the icon entirely and set the name in a
   geometric sans. The wordmark is real text in the site's Inter rather than an
   image, so it stays crisp, selectable and correctly hinted at any zoom, and
   it inherits whatever colour the surface behind it needs.

   The favicon is the one place that must be an image: img/favicon.svg draws
   the capital "L" from the wordmark as a path on the navy tile, so it renders
   identically everywhere without depending on a font being available.

   The wordmark uses two tones of the same emerald, chosen by what sits behind
   it, because no single green clears contrast on both navy and white:

     --lf-emerald-500  #12b981  6.2:1 on the navy sidebar, 3.3:1 on the hero
     --lf-emerald-700  #087a54  5.4:1 on the white cards

   At 28px bold the wordmark counts as large text, so 3:1 is the bar to clear.
   -------------------------------------------------------------------------- */
.logo-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Authentication screens
   -------------------------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background: radial-gradient(60rem 30rem at 50% -10rem, var(--lf-navy-050), transparent 60%), var(--lf-canvas);
}

.auth-card {
    width: 100%;
    max-width: 26rem;
    background-color: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius-lg);
    box-shadow: var(--lf-shadow-md);
    padding: 2.25rem;
}

@media (max-width: 575.98px) {
    .auth-card {
        padding: 1.75rem;
    }
}

.auth-heading {
    margin-bottom: 1.5rem;
}

    .auth-heading h1,
    .auth-heading h2 {
        font-size: 1.375rem;
        font-weight: 600;
        letter-spacing: -0.02em;
        margin-bottom: 0.375rem;
    }

    .auth-heading p {
        font-size: 0.9375rem;
        color: var(--lf-ink-muted);
        margin-bottom: 0;
    }

.auth-footer {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.875rem;
    color: var(--lf-ink-muted);
}

    .auth-footer a {
        font-weight: 600;
    }

/* Icon prefix inside input groups */
.input-group-text {
    background-color: var(--lf-surface-alt);
    border-color: var(--lf-border-strong);
    color: var(--lf-ink-subtle);
    padding-left: 0.875rem;
    padding-right: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;

    /* Bootstrap hardcodes a 0.375rem radius here while .form-control is set to
       --lf-radius-sm, so the two halves of a group were rounded at different
       sizes - 6px on the chip against 8px on the input. The two outer corners of
       a group belong to different elements, so the radius has to be given to
       both or the field reads as two shapes rather than one. */
    border-radius: var(--lf-radius-sm);
}

    .input-group-text i {
        font-size: 1rem;
        line-height: 1.2;
    }

/* The seam between the icon and the input is drawn by one border, not two.

   Only strip the input's left border when something actually sits to its left.
   When the input is the first child - a suffix group, e.g. an input followed by
   a "%" chip - that left edge is the outer edge of the whole group, and the
   input is the element carrying the rounded corner. Dropping the border there
   leaves the corner unrounded by any line and the input's own background
   showing through it, so the field reads as though it fades to white down the
   left-hand side. */
.input-group > .form-control:not(:first-child) {
    border-left-width: 0;
}

/* ASP.NET appends a hidden input carrying the culture-invariant value of a
   numeric field, so jQuery validation parses it the same way on every machine.
   That hidden input is a child of the group like any other, so the visible
   input beside it stops being :last-child - and Bootstrap reads :last-child as
   "this is the outer edge of the group" and squares off its right-hand corners.
   Text fields get no hidden input, which is why only the number fields appeared
   cut off on the right while the text fields beside them looked right.

   The hidden input is display:none, so it is never the visible edge. Give the
   radius back to whatever element really does end the group: the one sitting
   immediately before a hidden input that is itself last. A suffix group puts its
   chip after the hidden input, so the chip is still :last-child, is left alone
   here, and keeps its seam with the input.

   The !important is needed because the rule being overridden chains six
   :not() selectors and so outranks anything shorter written against it. */
.input-group > :has(+ input[type="hidden"]:last-child) {
    border-top-right-radius: var(--lf-radius-sm) !important;
    border-bottom-right-radius: var(--lf-radius-sm) !important;
}

/* The group is the field, so it carries the ring and the keyboard outline and
   wraps the icon and the input together. The input must stop drawing its own,
   otherwise the active border shows up twice and reads as a secondary outline
   around the input alone. */
    .input-group:focus-within {
        border-radius: var(--lf-radius-sm);
        box-shadow: var(--lf-ring);
    }

        .input-group:has(> .form-control:focus-visible) {
            outline: 2px solid var(--lf-navy-600);
            outline-offset: 2px;
        }

        .input-group > .form-control:focus,
        .input-group > .form-control:focus-visible {
            box-shadow: none;
            outline: none;
        }

/* Both halves take the focus colour so the border runs unbroken across the
   seam and the field reads as one control. */
    .input-group:focus-within > .input-group-text {
        border-color: var(--lf-navy-600);
        color: var(--lf-navy-600);
    }

/* Validation follows the same shape, so an invalid field never shows a navy
   icon beside a red border. Only an active invalid field gets the ring, an
   idle one keeps its plain red border. */
    .input-group:has(> .input-validation-error) > .input-group-text {
        border-color: var(--lf-danger);
        color: var(--lf-danger);
    }

        .input-group:focus-within:has(> .input-validation-error) {
            box-shadow: var(--lf-ring-danger);
        }

/* Beats the !important on .input-validation-error:focus further up this file. */
        .input-group > .input-validation-error:focus {
            box-shadow: none !important;
        }

/* The validation message is no longer a child of the input group - it sits
   after it, in flow. Nothing to position and no space to reserve: it takes
   however many lines it needs. The rule this replaced anchored the message
   below the field and guessed 1.75rem of room for it, which was one line
   short as soon as the text wrapped, and the tail of the message landed on
   whatever followed the field. */

/* --------------------------------------------------------------------------
   Landing page
   -------------------------------------------------------------------------- */
.landing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background: radial-gradient(70rem 40rem at 15% 0%, var(--lf-navy-050), transparent 55%), var(--lf-canvas);
}

.landing-panel {
    width: 100%;
    max-width: 64rem;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    background-color: var(--lf-surface);
    border: 1px solid var(--lf-border);
    border-radius: var(--lf-radius-lg);
    box-shadow: var(--lf-shadow-lg);
    overflow: hidden;
}

@media (max-width: 899.98px) {
    .landing-panel {
        grid-template-columns: 1fr;
    }
}

.landing-hero {
    padding: 3rem;
    background: linear-gradient(150deg, var(--lf-navy-800) 0%, var(--lf-navy-950) 100%);
    color: rgba(255, 255, 255, 0.82);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 575.98px) {
    .landing-hero {
        padding: 2rem 1.75rem;
    }
}

.landing-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: #fff;
    margin-bottom: 1rem;
}

    /*
   The wordmark sits inside the headline rather than above it, so it has to
   read as the word "life" first and as the brand second: same size, weight and
   rhythm as the surrounding sentence, with only the colour marking it out.
*/
    .landing-hero h1 .logo-name {
        font-size: inherit;
        font-weight: inherit;
        line-height: inherit;
        letter-spacing: -0.035em;
        color: var(--lf-emerald-500);
    }

@media (max-width: 575.98px) {
    .landing-hero h1 {
        font-size: 1.625rem;
    }
}

.landing-hero > p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
    max-width: 26rem;
}

.landing-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

    .landing-points li {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        font-size: 0.9375rem;
    }

    .landing-points i {
        color: var(--lf-emerald-500);
        font-size: 1.0625rem;
        flex-shrink: 0;
    }

.landing-actions {
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 575.98px) {
    .landing-actions {
        padding: 2rem 1.75rem 2.5rem;
    }
}

.landing-actions .auth-card {
    max-width: none;
    border: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
}

/* --------------------------------------------------------------------------
   Error page
   -------------------------------------------------------------------------- */
.error-page {
    display: flex;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.error-card {
    text-align: center;
    max-width: 28rem;
}

.error-code {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--lf-ink-subtle);
    margin-bottom: 0.5rem;
}

.error-card h1 {
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
}
