﻿/* ---------------------------------------------------------------------------
   LondyStance design tokens.

   Everything visual should read from these rather than hardcoding hex values.
   The duel board and score strip currently declare their own copies with the
   same values — safe to swap them for var(--ls-*) whenever you next touch them.
   --------------------------------------------------------------------------- */

:root {
    --ls-ink: #1f1b26;
    --ls-ink-soft: #3a3446;
    --ls-muted: #7b7688;
    --ls-line: #e2dde6;
    --ls-paper: #fbf9fa;
    --ls-surface: #ffffff;
    --ls-rose: #b8456b;
    --ls-rose-dark: #a03c5e;
    --ls-rose-tint: #f7e9ef;
    --ls-correct: #3f7d6a;
    --ls-present: #c98a3c;
    --ls-absent: #6b6878;
    --ls-radius: .5rem;
    --ls-radius-lg: .85rem;
    --ls-shadow: 0 1px 2px rgba(31, 27, 38, .05), 0 10px 28px -16px rgba(31, 27, 38, .28);
}

body {
    background: var(--ls-paper);
    color: var(--ls-ink);
}

/* --- mobile & touch ------------------------------------------------------
   viewport-fit=cover in App.razor is what makes env(safe-area-inset-*) return
   anything other than 0. Without it none of the inset handling does a thing.
   ------------------------------------------------------------------------- */

html {
    /* Stops iOS inflating text when the phone is turned sideways. */
    -webkit-text-size-adjust: 100%;
}

body {
    /* Kills the grey flash Android draws over every tapped element. */
    -webkit-tap-highlight-color: transparent;
}

@media (display-mode: standalone) {
    body {
        /* Installed apps shouldn't pull-to-refresh — it feels broken when there's
           no address bar to explain it. Left alone in a normal browser tab. */
        overscroll-behavior-y: none;
    }
}

/* --- primitives ---------------------------------------------------------- */

.ls-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    /* 2.75rem = 44px, the smallest comfortable touch target. */
    min-height: 2.75rem;
    padding: 0 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--ls-radius);
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color .12s ease, border-color .12s ease;
}

    .ls-btn:disabled,
    .ls-btn[aria-disabled="true"] {
        opacity: .5;
        cursor: default;
    }

    .ls-btn:focus-visible {
        outline: 2px solid var(--ls-rose);
        outline-offset: 2px;
    }

.ls-btn-primary {
    background: var(--ls-rose);
    color: #fff;
}

    .ls-btn-primary:hover:not(:disabled) {
        background: var(--ls-rose-dark);
        color: #fff;
    }

.ls-btn-ghost {
    background: transparent;
    border-color: var(--ls-line);
    color: var(--ls-ink);
}

    .ls-btn-ghost:hover:not(:disabled) {
        background: #fff;
        border-color: var(--ls-muted);
        color: var(--ls-ink);
    }

.ls-btn-quiet {
    height: auto;
    min-height: 0;
    /* Vertical padding rather than min-height, so it still sits inline in a
       sentence while giving thumbs something to hit. */
    padding: .5rem 0;
    border: 0;
    background: none;
    color: var(--ls-rose);
    font-family: inherit;
    font-size: .82rem;
    text-decoration: underline;
    cursor: pointer;
    touch-action: manipulation;
}

.ls-btn-lg {
    min-height: 3rem;
    padding: 0 1.5rem;
    font-size: .95rem;
}

.ls-card {
    max-width: 26rem;
    margin: 1rem auto 0;
    padding: 1.15rem 1.25rem;
    background: var(--ls-surface);
    border: 1px solid var(--ls-line);
    border-radius: var(--ls-radius-lg);
    box-shadow: var(--ls-shadow);
}

.ls-card-title {
    margin: 0 0 .5rem;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ls-muted);
}

.ls-card-text {
    margin: 0 0 1rem;
    font-size: .9rem;
    color: var(--ls-ink-soft);
}

.ls-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 2.6rem;
    padding: 0 .75rem;
    border: 1px solid var(--ls-line);
    border-radius: var(--ls-radius);
    background: #fff;
    font-family: inherit;
    font-size: .9rem;
    color: var(--ls-ink);
}

    .ls-input:focus {
        outline: none;
        border-color: var(--ls-rose);
        box-shadow: 0 0 0 3px rgba(184, 69, 107, .14);
    }

.ls-error {
    margin: .6rem 0 0;
    font-size: .84rem;
    color: var(--ls-rose);
}

/* --- skeletons ----------------------------------------------------------- */

.ls-skeleton {
    background: linear-gradient(90deg, var(--ls-line) 25%, #efebf1 37%, var(--ls-line) 63%);
    background-size: 400% 100%;
    animation: ls-shimmer 1.4s ease infinite;
    border-color: transparent !important;
}

@keyframes ls-shimmer {
    from {
        background-position: 100% 50%;
    }

    to {
        background-position: 0 50%;
    }
}

/* --- landing ------------------------------------------------------------- */

.ls-landing {
    max-width: 26rem;
    margin: 4rem auto 0;
    text-align: center;
}

    .ls-landing img {
        width: 4.5rem;
        height: 4.5rem;
    }

    .ls-landing h1 {
        margin: 1.1rem 0 .4rem;
        font-size: 2rem;
        font-weight: 700;
        letter-spacing: -.02em;
    }

    .ls-landing p {
        margin: 0 0 2rem;
        color: var(--ls-muted);
        font-size: 1rem;
    }

.ls-landing-actions {
    display: flex;
    justify-content: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.ls-greeting {
    margin: 0 auto;
    max-width: 26rem;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

/* --- Bootstrap re-skin ---------------------------------------------------
   The scaffolded Identity pages are Bootstrap and rewriting them all isn't
   worth it, so retune Bootstrap's own custom properties instead. Everything
   below only affects those pages.
   ------------------------------------------------------------------------- */

.btn-primary {
    --bs-btn-bg: var(--ls-rose);
    --bs-btn-border-color: var(--ls-rose);
    --bs-btn-hover-bg: var(--ls-rose-dark);
    --bs-btn-hover-border-color: var(--ls-rose-dark);
    --bs-btn-active-bg: var(--ls-rose-dark);
    --bs-btn-active-border-color: var(--ls-rose-dark);
    --bs-btn-disabled-bg: var(--ls-rose);
    --bs-btn-disabled-border-color: var(--ls-rose);
    --bs-btn-focus-shadow-rgb: 184, 69, 107;
}

.btn-outline-primary {
    --bs-btn-color: var(--ls-rose);
    --bs-btn-border-color: var(--ls-line);
    --bs-btn-hover-bg: var(--ls-rose);
    --bs-btn-hover-border-color: var(--ls-rose);
    --bs-btn-active-bg: var(--ls-rose-dark);
    --bs-btn-active-border-color: var(--ls-rose-dark);
    --bs-btn-focus-shadow-rgb: 184, 69, 107;
}

.btn-link,
a {
    color: var(--ls-rose);
}

    a:hover {
        color: var(--ls-rose-dark);
    }

.form-control:focus,
.form-select:focus {
    border-color: var(--ls-rose);
    box-shadow: 0 0 0 .2rem rgba(184, 69, 107, .15);
}

.form-floating > label {
    color: var(--ls-muted);
}

.card {
    border-color: var(--ls-line);
    border-radius: var(--ls-radius-lg);
}

/* --- small screens -------------------------------------------------------- */

@media (max-width: 480px) {
    .ls-landing {
        margin-top: 2.5rem;
    }

        .ls-landing h1 {
            font-size: 1.75rem;
        }

        .ls-landing p {
            margin-bottom: 1.5rem;
            font-size: .95rem;
        }

    .ls-landing-actions {
        flex-direction: column;
    }

        .ls-landing-actions .ls-btn {
            width: 100%;
        }

    .ls-card {
        padding: 1rem;
    }

    .ls-greeting {
        font-size: 1.1rem;
    }
}

/* --- auth pages -----------------------------------------------------------
   Shared by Register and Login, and ready for ForgotPassword, ResetPassword,
   ResendEmailConfirmation and RegisterConfirmation when those get the same
   treatment. Lives here rather than in a <style> block precisely because more
   than two pages need it.
   ------------------------------------------------------------------------- */

.auth {
    max-width: 24rem;
    margin: 2rem auto 3rem;
}

.auth-head {
    text-align: center;
    margin-bottom: 1.6rem;
}

    .auth-head img {
        width: 3.25rem;
        height: 3.25rem;
    }

.auth-title {
    margin: .85rem 0 .3rem;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.auth-sub {
    margin: 0;
    font-size: .88rem;
    color: var(--ls-muted);
}

.auth-card {
    padding: 1.5rem 1.4rem;
    background: var(--ls-surface);
    border: 1px solid var(--ls-line);
    border-radius: var(--ls-radius-lg);
    box-shadow: var(--ls-shadow);
}

.auth-field {
    margin-bottom: 1rem;
}

    .auth-field > label {
        display: block;
        margin-bottom: .35rem;
        font-size: .8rem;
        font-weight: 600;
        color: var(--ls-ink-soft);
    }

    .auth-field .ls-input {
        width: 100%;
    }

.auth-submit {
    width: 100%;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0 0 1.25rem;
    font-size: .85rem;
    color: var(--ls-ink-soft);
    cursor: pointer;
}

    .auth-check input {
        width: 1.05rem;
        height: 1.05rem;
        margin: 0;
        accent-color: var(--ls-rose);
    }

.auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.35rem 0;
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ls-muted);
}

    .auth-divider::before,
    .auth-divider::after {
        content: "";
        flex: 1 1 auto;
        height: 1px;
        background: var(--ls-line);
    }

.auth-links {
    display: grid;
    gap: .55rem;
    margin: 1.35rem 0 0;
    padding-top: 1.1rem;
    border-top: 1px solid var(--ls-line);
    font-size: .85rem;
    text-align: center;
}

    .auth-links a {
        text-decoration: none;
    }

        .auth-links a:hover {
            text-decoration: underline;
        }

.auth-foot {
    margin: 1.4rem 0 0;
    text-align: center;
    font-size: .87rem;
    color: var(--ls-muted);
}

/* Validation. These beat the template rules in app.css on specificity, so an
   invalid field gets a rose border instead of a red outline and a valid one
   gets nothing instead of a green halo. app.css is left alone because those
   rules still apply on the Manage pages. */

.auth .validation-message {
    display: block;
    margin-top: .35rem;
    font-size: .78rem;
    color: var(--ls-rose);
}

.auth .ls-input.invalid {
    border-color: var(--ls-rose);
    outline: none;
}

.auth .ls-input.valid.modified {
    outline: none;
}

.auth-summary {
    margin: 0 0 1rem;
    padding: 0 0 0 1.1rem;
    font-size: .8rem;
    color: var(--ls-rose);
}

    .auth-summary:empty {
        display: none;
    }

/* StatusMessage renders Bootstrap alerts; nudge them onto the palette. */

.auth .alert {
    padding: .7rem .85rem;
    border-radius: var(--ls-radius);
    font-size: .85rem;
}

.auth .alert-danger {
    background: var(--ls-rose-tint);
    border-color: rgba(184, 69, 107, .3);
    color: var(--ls-rose-dark);
}

.auth .alert-success {
    background: #e9f2ef;
    border-color: rgba(63, 125, 106, .3);
    color: var(--ls-correct);
}

.auth-message {
    text-align: center;
}

    .auth-message p {
        margin: 0 0 1.35rem;
        font-size: .9rem;
        line-height: 1.55;
        color: var(--ls-ink-soft);
    }

        .auth-message p:last-of-type {
            margin-bottom: 1.35rem;
        }

.auth-hint {
    margin: -.15rem 0 1.1rem;
    font-size: .82rem;
    line-height: 1.5;
    color: var(--ls-muted);
}

.auth-email {
    display: block;
    margin: 0 0 1.1rem;
    padding: .55rem .75rem;
    border-radius: var(--ls-radius);
    background: var(--ls-rose-tint);
    font-size: .88rem;
    font-weight: 600;
    color: var(--ls-ink);
    word-break: break-all;
}

.pw-field {
    position: relative;
}

    .pw-field .ls-input {
        padding-right: 2.9rem;
    }

.pw-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 2.75rem;
    height: 2.6rem;
    border: 0;
    border-radius: var(--ls-radius);
    background: transparent no-repeat center/1.15rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b7688' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    cursor: pointer;
}

    .pw-toggle:hover {
        background-color: #f3f0f5;
    }

    .pw-toggle.is-on {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8456b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
    }


/*    DuelPage CSS       */

.duel-page {
    position: relative;
}

.back-link {
    display: inline-block;
    margin-bottom: .25rem;
    font-size: .82rem;
    color: var(--ls-muted);
    text-decoration: none;
}

    .back-link:hover {
        color: var(--ls-rose);
    }



/* --- legal pages --------------------------------------------------------- */

.legal {
    max-width: 40rem;
    margin: 2rem auto 4rem;
}

    .legal h1 {
        margin: 0 0 .35rem;
        font-size: 1.85rem;
        font-weight: 700;
        letter-spacing: -.02em;
    }

    .legal h2 {
        margin: 2rem 0 .6rem;
        font-size: 1.05rem;
        font-weight: 700;
        letter-spacing: -.01em;
    }

    .legal p,
    .legal li {
        font-size: .92rem;
        line-height: 1.65;
        color: var(--ls-ink-soft);
    }

    .legal p {
        margin: 0 0 .85rem;
    }

    .legal ul {
        margin: 0 0 .85rem;
        padding-left: 1.25rem;
        display: grid;
        gap: .4rem;
    }

    .legal strong {
        color: var(--ls-ink);
    }

.legal-date {
    margin: 0 0 1.75rem !important;
    font-size: .76rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ls-muted);
}

.legal-lead {
    padding: .85rem 1rem;
    border-radius: var(--ls-radius);
    background: var(--ls-rose-tint);
    font-size: .95rem !important;
    color: var(--ls-ink) !important;
}

.legal-back {
    margin-top: 2.5rem !important;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ls-line);
    font-size: .86rem !important;
}
