/* ==================================================================
   LinkLeafQR brand system
   Spruce ink, leaf green, and one loud sticker yellow.
   ================================================================== */

:root {
    --ink: #10261f;
    --ink-soft: #2c4238;
    --muted: #5a6b62;
    --paper: #f5f7f2;
    --card: #ffffff;
    --line: #d5e0d8;
    --line-strong: #b9cbbf;
    --leaf: #1f7a4d;
    --leaf-deep: #145c39;
    --leaf-tint: #e3f1e8;
    --sticker: #ffd54a;
    --sticker-deep: #e9b800;
    --spruce: #0f2b22;
    --on-spruce: #eef5ef;
    --danger: #b42318;
    --danger-tint: #fdecea;
    --ok-tint: #e3f1e8;

    --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
    --font-body: "Instrument Sans", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 20px;
    --r-sticker: 28px;
    --shadow-card: 0 1px 0 rgba(16, 38, 31, .04), 0 12px 32px -18px rgba(16, 38, 31, .28);
    --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--leaf);
    --ease: cubic-bezier(.2, .7, .2, 1);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ink: #e8f0ea;
        --ink-soft: #c5d4ca;
        --muted: #9db0a5;
        --paper: #0c1813;
        --card: #13231c;
        --line: #24382e;
        --line-strong: #345043;
        --leaf: #4cc37f;
        --leaf-deep: #6fd89a;
        --leaf-tint: #173527;
        --spruce: #081410;
        --danger: #ff8a7a;
        --danger-tint: #3a1713;
        --ok-tint: #173527;
        --shadow-card: 0 1px 0 rgba(0, 0, 0, .3), 0 16px 40px -20px rgba(0, 0, 0, .7);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
img, svg, canvas { max-width: 100%; }
a { color: var(--leaf); text-underline-offset: 3px; }
a:hover { color: var(--leaf-deep); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

/* ---------- Type ---------- */
.ll-h1, .ll-h2, .ll-h3 { font-family: var(--font-display); color: var(--ink); margin: 0; }
.ll-h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 2.6rem); line-height: 1.05; font-weight: 750; letter-spacing: -0.025em; }
.ll-h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); line-height: 1.1; font-weight: 720; letter-spacing: -0.02em; }
.ll-h3 { font-size: 1.15rem; line-height: 1.3; font-weight: 680; letter-spacing: -0.01em; }
.ll-muted { color: var(--muted); }
.ll-small { font-size: .875rem; }

/* ---------- Logo ---------- */
.ll-logo {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--font-display); font-weight: 760; font-size: 1.2rem;
    color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
}
.ll-logo em { font-style: normal; color: var(--leaf); }
.ll-logo:hover { color: var(--ink); }
.ll-logo-mark {
    width: 30px; height: 30px; flex: none; border-radius: 9px;
    background:
        radial-gradient(circle at 30% 30%, var(--sticker) 0 5px, transparent 5.5px),
        var(--spruce);
    position: relative;
    box-shadow: inset 0 0 0 2px var(--leaf);
}
.ll-logo-mark::after {
    /* a leaf-shaped finder pattern */
    content: ""; position: absolute; right: 5px; bottom: 5px; width: 12px; height: 12px;
    background: var(--leaf); border-radius: 0 10px 0 10px;
}

/* ---------- Buttons ---------- */
.ll-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 20px; border-radius: var(--r-md);
    border: 1.5px solid transparent; cursor: pointer;
    font: 600 1rem/1 var(--font-body); text-decoration: none; white-space: nowrap;
    transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.ll-btn:active { transform: translateY(1px); }
.ll-btn-primary { background: var(--leaf); color: #fff; }
.ll-btn-primary:hover { background: var(--leaf-deep); color: #fff; }
.ll-btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.ll-btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.ll-btn-sticker { background: var(--sticker); color: #10261f; }
.ll-btn-sticker:hover { background: var(--sticker-deep); color: #10261f; }
.ll-btn-danger { background: var(--danger); color: #fff; }
.ll-btn-block { width: 100%; }
.ll-btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Forms ---------- */
.ll-field { display: grid; gap: 6px; margin-bottom: 16px; }
.ll-label { font-weight: 600; font-size: .92rem; color: var(--ink-soft); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ll-label a { font-weight: 500; font-size: .875rem; }
.ll-input-wrap { position: relative; }
.ll-input {
    width: 100%; min-height: 48px; padding: 12px 14px;
    border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
    background: var(--card); color: var(--ink);
    font: 400 1rem/1.3 var(--font-body);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.ll-input::placeholder { color: var(--muted); opacity: .8; }
.ll-input:hover { border-color: var(--muted); }
.ll-input:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 4px color-mix(in srgb, var(--leaf) 18%, transparent); }
.ll-input-wrap .ll-input { padding-right: 76px; }
.ll-reveal {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; color: var(--leaf); cursor: pointer;
    font: 600 .85rem var(--font-body); padding: 8px 10px; border-radius: var(--r-sm);
}
.ll-reveal:hover { background: var(--leaf-tint); }
.ll-hint { font-size: .85rem; color: var(--muted); }
.ll-check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--ink-soft); margin: 4px 0 18px; }
.ll-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--leaf); flex: none; }

/* Password strength meter */
.ll-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 4px; }
.ll-meter i { height: 4px; border-radius: 4px; background: var(--line); transition: background-color .2s; }
.ll-meter[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.ll-meter[data-score="2"] i:nth-child(-n+2) { background: var(--sticker-deep); }
.ll-meter[data-score="3"] i:nth-child(-n+3) { background: var(--leaf); }
.ll-meter[data-score="4"] i { background: var(--leaf); }

/* ---------- Alerts ---------- */
.ll-alert { border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 18px; font-size: .95rem; border: 1px solid; }
.ll-alert-error { background: var(--danger-tint); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.ll-alert-ok { background: var(--ok-tint); border-color: color-mix(in srgb, var(--leaf) 35%, transparent); color: var(--ink); }
.ll-alert ul { margin: 0; padding-left: 18px; }

/* ---------- Card ---------- */
.ll-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow-card); }

/* ==================================================================
   Auth pages (login, register, reset): form left, promise right
   ================================================================== */
body.ll-auth { min-height: 100vh; }
.ll-auth-grid { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ll-auth-main { display: flex; flex-direction: column; padding: 28px clamp(20px, 5vw, 64px); }
.ll-auth-main > .ll-logo { align-self: flex-start; }
.ll-auth-form { width: 100%; max-width: 420px; margin: auto; padding: 40px 0; }
.ll-auth-form .ll-h1 { margin-bottom: 8px; }
.ll-auth-form > .ll-muted { margin: 0 0 28px; }
.ll-auth-foot { margin-top: 22px; font-size: .95rem; color: var(--muted); }
.ll-auth-legal { font-size: .8rem; color: var(--muted); }
.ll-auth-shell { max-width: 460px; margin: 0 auto; padding: 32px 20px 60px; display: grid; gap: 28px; }

.ll-auth-aside {
    background: var(--spruce); color: var(--on-spruce);
    display: flex; flex-direction: column; justify-content: center; gap: 36px;
    padding: 56px clamp(28px, 5vw, 72px); position: relative; overflow: hidden;
}
.ll-auth-aside h2 { font-family: var(--font-display); font-weight: 760; font-size: clamp(1.9rem, 1.2rem + 2vw, 2.8rem); line-height: 1.02; letter-spacing: -0.03em; margin: 0; max-width: 14ch; color: #fff; }
.ll-auth-aside p { color: #b8cdbf; max-width: 40ch; margin: 0; }
.ll-auth-aside ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: #d8e6dc; }
.ll-auth-aside li { display: flex; gap: 10px; align-items: baseline; }
.ll-auth-aside li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--sticker); flex: none; transform: translateY(-1px); }

/* The sticker: a die-cut yellow label holding a QR code */
.ll-sticker {
    width: min(300px, 70vw); aspect-ratio: 1; padding: 22px;
    background: var(--sticker); border-radius: var(--r-sticker);
    box-shadow: 0 2px 0 #c99c00, 0 30px 60px -24px rgba(0, 0, 0, .55);
    transform: rotate(-4deg); position: relative; display: grid; place-items: center;
}
.ll-sticker::before { /* the peel corner */
    content: ""; position: absolute; right: 0; bottom: 0; width: 46px; height: 46px;
    background: linear-gradient(135deg, var(--sticker-deep) 0 50%, transparent 50%);
    border-radius: 0 0 var(--r-sticker) 0; filter: drop-shadow(-3px -3px 3px rgba(0,0,0,.18));
}
.ll-sticker-inner { width: 100%; height: 100%; background: #fff; border-radius: 14px; padding: 12px; display: grid; place-items: center; }
.ll-sticker-inner svg, .ll-sticker-inner canvas { width: 100%; height: 100%; display: block; }

@media (max-width: 900px) {
    .ll-auth-grid { grid-template-columns: 1fr; }
    .ll-auth-aside { display: none; }
    .ll-auth-form { padding-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
