/* ==========================================================================
   PetPass Admin — sticker-book edition, matching the marketing site.
   Cream paper, brand teal, coral, sunny yellow. Fredoka / Nunito / Space Mono.
   Hand-authored (no build step): served straight from public/.
   ========================================================================== */

:root {
    /* paper & ink (from the marketing site) */
    --paper: #fdf6ec;
    --paper-deep: #f6ead6;
    --card: #fffdf8;
    --ink: #223c3c;
    --ink-soft: #566966;
    --ink-mute: #8fa09b;
    --line: #ece0cb;
    --line-strong: #ddccb0;

    /* brand teals (token names kept from the old green scheme) */
    --green-950: #0e2f33;
    --green-900: #123a3f;
    --green-800: #164348;
    --green-700: #235c65;
    --green-600: #2f9d94;
    --green-100: #d9e8e6;
    --green-050: #e6f2ef;

    /* accents */
    --stamp: #e35d5a;
    --stamp-soft: #f7d8d4;
    --gold: #fbc94a;
    --gold-deep: #eeb42c;

    /* data (validated on --paper surface) */
    --viz-series: #2f9d94;
    --viz-serious: #cd4744;
    --viz-warning: #eeb42c;

    /* type */
    --serif: 'Fredoka', system-ui, 'Segoe UI', sans-serif;
    --sans: 'Nunito', system-ui, 'Segoe UI', sans-serif;
    --mono: 'Poppins', system-ui, 'Segoe UI', sans-serif;

    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(31, 81, 89, 0.05), 0 10px 30px -18px rgba(31, 81, 89, 0.35);
    --shadow-pop: 0 24px 60px -24px rgba(14, 47, 51, 0.5);
    --sidebar-w: 248px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

/* paper grain over everything, beneath interaction */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 60;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--green-600); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--ink); margin: 0; }

::selection { background: var(--gold); color: var(--green-950); }

/* ── micro components ──────────────────────────────────────────────────── */

.kicker {
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

.mono { font-family: var(--mono); }

hr.perf {
    border: none;
    border-top: 1.5px dashed var(--line-strong);
    margin: 0;
}

/* ── shell ─────────────────────────────────────────────────────────────── */

.shell { display: flex; min-height: 100vh; min-height: 100svh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(251, 201, 74, 0.12), transparent 55%),
        linear-gradient(180deg, var(--green-900), var(--green-950));
    color: #eef6f2;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
}

.sidebar-brand {
    padding: 26px 22px 20px;
    border-bottom: 1px dashed rgba(238, 246, 242, 0.25);
}

.sidebar-brand .brand-sticker {
    display: block;
    background: #fff;
    border-radius: 14px;
    padding: 10px 14px;
    transform: rotate(-1.5deg);
    box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease;
}

.sidebar-brand .brand-sticker:hover { transform: rotate(0deg) scale(1.02); }

.sidebar-brand .brand-sticker img { display: block; width: 100%; height: auto; }

.sidebar-brand .sub {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    margin-top: 6px;
}

.sidebar nav { padding: 14px 12px; flex: 1; overflow-y: auto; }

.nav-label {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(238, 246, 242, 0.45);
    padding: 14px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    margin: 2px 0;
    border-radius: var(--radius-sm);
    color: rgba(238, 246, 242, 0.78);
    font-weight: 500;
    font-size: 14px;
    position: relative;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-item svg { opacity: 0.75; flex-shrink: 0; }

.nav-item:hover {
    background: rgba(238, 246, 242, 0.08);
    color: #fbfdfb;
    text-decoration: none;
}

.nav-item.active {
    background: var(--paper);
    color: var(--green-900);
    font-weight: 600;
    box-shadow: 0 2px 10px -4px rgba(0, 0, 0, 0.5);
}

.nav-item.active svg { opacity: 1; }

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    border-radius: 0 3px 3px 0;
    background: var(--stamp);
}

.sidebar-foot {
    padding: 16px;
    border-top: 1px dashed rgba(238, 246, 242, 0.25);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-foot .who { flex: 1; min-width: 0; }

.sidebar-foot .who .name {
    font-size: 13px;
    font-weight: 600;
    color: #fbfdfb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-foot .who .mail {
    font-family: var(--mono);
    font-size: 10.5px;
    color: rgba(238, 246, 242, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar-chip {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--green-950);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logout-btn {
    background: none;
    border: 1px solid rgba(238, 246, 242, 0.3);
    color: rgba(238, 246, 242, 0.75);
    border-radius: var(--radius-sm);
    padding: 7px 8px;
    cursor: pointer;
    display: flex;
    transition: border-color 0.15s, color 0.15s;
}

.logout-btn:hover { border-color: var(--stamp); color: #fbfdfb; }

.main { flex: 1; min-width: 0; padding: 30px 36px 60px; }

/* ── page header ───────────────────────────────────────────────────────── */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-head h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.01em; }

.page-head .kicker { margin-bottom: 6px; }

.page-head .lede { color: var(--ink-soft); font-size: 13.5px; margin: 6px 0 0; max-width: 56ch; }

.page-actions { display: flex; gap: 10px; align-items: center; }

/* ── cards ─────────────────────────────────────────────────────────────── */

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-pad { padding: 20px 22px; }

.card-head {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-head h2 { font-size: 17px; }

/* ── stat tiles ────────────────────────────────────────────────────────── */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px 14px;
    position: relative;
    overflow: hidden;
}

.stat::before {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 0;
    border-left: 3px dashed var(--line-strong);
}

.stat .kicker { display: block; margin-bottom: 8px; }

.stat .num {
    font-family: var(--mono);
    font-size: 30px;
    font-weight: 600;
    line-height: 1;
    color: var(--green-900);
    letter-spacing: -0.02em;
}

.stat .sub { font-size: 12px; color: var(--ink-soft); margin-top: 7px; display: flex; align-items: center; gap: 6px; }

.stat .sub .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ── stamp badges ──────────────────────────────────────────────────────── */

.stamp-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border: 1.5px solid currentColor;
    border-radius: 5px;
    padding: 2.5px 7px;
    transform: rotate(-1.5deg);
}

.stamp-badge.red { color: var(--stamp); background: rgba(227, 93, 90, 0.08); }
.stamp-badge.green { color: var(--green-600); background: rgba(47, 157, 148, 0.1); }
.stamp-badge.gold { color: #8a6d1a; background: rgba(238, 180, 44, 0.14); }
.stamp-badge.plain { color: var(--ink-mute); transform: none; border-style: dashed; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 99px;
    padding: 3px 10px;
    white-space: nowrap;
}

.pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.pill.green { background: var(--green-050); color: var(--green-800); }
.pill.green .dot { background: var(--viz-series); }
.pill.gold { background: #fdeec3; color: #8a6d1a; }
.pill.gold .dot { background: var(--viz-warning); }
.pill.red { background: var(--stamp-soft); color: #a13835; }
.pill.red .dot { background: var(--viz-serious); }
.pill.plain { background: var(--paper-deep); color: var(--ink-soft); }
.pill.plain .dot { background: var(--ink-mute); }

.tag-chip {
    display: inline-block;
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-soft);
    background: var(--paper-deep);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1.5px 7px;
    margin: 1px 3px 1px 0;
    white-space: nowrap;
}

.swatch {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 4px;
    border: 1px solid rgba(34, 60, 60, 0.2);
    vertical-align: -2px;
}

/* ── buttons ───────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: var(--sans);
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--green-600); color: #fff; box-shadow: 0 8px 18px -10px rgba(47, 157, 148, 0.6); }
.btn-primary:hover { background: var(--green-700); }

.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--green-600); color: var(--green-600); }

.btn-danger { background: transparent; border-color: rgba(227, 93, 90, 0.45); color: var(--stamp); }
.btn-danger:hover { background: var(--stamp); border-color: var(--stamp); color: #fffdf7; }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }

.icon-btn {
    background: none;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink-soft);
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.icon-btn:hover { border-color: var(--green-600); color: var(--green-600); background: var(--green-050); }
.icon-btn.danger:hover { border-color: var(--stamp); color: var(--stamp); background: var(--stamp-soft); }

/* ── forms ─────────────────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.field > label {
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.input, textarea.input, select.input {
    font-family: var(--sans);
    font-size: 14px;
    color: var(--ink);
    background: #fffefa;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus, textarea.input:focus, select.input:focus {
    outline: none;
    border-color: var(--green-600);
    box-shadow: 0 0 0 3px rgba(47, 157, 148, 0.22);
}

.input::placeholder { color: var(--ink-mute); }

textarea.input { resize: vertical; min-height: 74px; line-height: 1.5; }

input.input[type='color'] { padding: 3px 5px; height: 38px; width: 54px; cursor: pointer; }

.field .hint { font-size: 11.5px; color: var(--ink-mute); }

.field .error, .error {
    font-size: 12px;
    color: var(--stamp);
    font-weight: 500;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    user-select: none;
}

.check-row input[type='checkbox'] {
    appearance: none;
    width: 19px;
    height: 19px;
    margin: 0;
    border: 1.5px solid var(--line-strong);
    border-radius: 5px;
    background: #fffefa;
    cursor: pointer;
    position: relative;
    transition: background 0.12s, border-color 0.12s;
}

.check-row input[type='checkbox']:checked { background: var(--green-600); border-color: var(--green-600); }

.check-row input[type='checkbox']:checked::after {
    content: '';
    position: absolute;
    left: 5.5px;
    top: 2px;
    width: 4.5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(42deg);
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }

.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-mute); pointer-events: none; }
.search-wrap .input { padding-left: 34px; min-width: 250px; }

/* ── tables ────────────────────────────────────────────────────────────── */

.table-scroll { overflow-x: auto; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

table.data th {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-mute);
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1.5px solid var(--line);
    white-space: nowrap;
}

table.data td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

table.data tbody tr { transition: background 0.1s ease; }
table.data tbody tr:hover { background: rgba(246, 234, 214, 0.55); }
table.data tbody tr:last-child td { border-bottom: none; }

table.data .primary-cell { font-weight: 600; color: var(--ink); }
table.data .sub-cell { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.num { font-family: var(--mono); font-size: 12.5px; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data td.actions .icon-btn + .icon-btn { margin-left: 6px; }

/* ── pagination ────────────────────────────────────────────────────────── */

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    border-top: 1.5px dashed var(--line-strong);
}

.pager .info { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); letter-spacing: 0.08em; }
.pager .controls { display: flex; gap: 8px; }

/* ── empty state ───────────────────────────────────────────────────────── */

.empty {
    text-align: center;
    padding: 46px 20px;
    color: var(--ink-soft);
}

.empty .glyph { font-size: 30px; margin-bottom: 8px; opacity: 0.85; }
.empty p { margin: 4px 0 0; font-size: 13px; }
.empty .kicker { display: block; margin-bottom: 2px; }

/* ── modal ─────────────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(14, 47, 51, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 6vh 18px 18px;
    overflow-y: auto;
}

.modal {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    width: 100%;
    max-width: 640px;
    animation: modal-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.modal.narrow { max-width: 460px; }

@keyframes modal-in {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

.modal-head {
    padding: 18px 24px 15px;
    border-bottom: 1.5px dashed var(--line-strong);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-head h2 { font-size: 19px; }

.modal-body { padding: 22px 24px; }

.modal-foot {
    padding: 15px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(246, 234, 214, 0.45);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ── toast ─────────────────────────────────────────────────────────────── */

.toast-host {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--green-950);
    color: #fbfdfb;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--gold);
    padding: 12px 18px;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: var(--shadow-pop);
    display: flex;
    align-items: center;
    gap: 9px;
    animation: toast-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

.toast.error { border-left-color: var(--stamp); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* ── chart (dashboard) ─────────────────────────────────────────────────── */

.chart-wrap { padding: 6px 22px 16px; }

.chart-bar { fill: var(--viz-series); transition: opacity 0.12s; }
.chart-col:hover .chart-bar { opacity: 0.75; }

.chart-val {
    font-family: var(--mono);
    font-size: 10px;
    fill: var(--ink-soft);
    text-anchor: middle;
    opacity: 0;
    transition: opacity 0.12s;
}

.chart-col:hover .chart-val, .chart-val.always { opacity: 1; }

.chart-day { font-family: var(--mono); font-size: 9px; fill: var(--ink-mute); text-anchor: middle; letter-spacing: 0.05em; }
.chart-base { stroke: var(--line-strong); stroke-width: 1; }
.chart-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }

/* ── dashboard extras: species mix + care shelf ────────────────────────── */

.mix-row { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; }

.mix-label {
    width: 96px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mix-track { flex: 1; height: 12px; background: var(--paper-deep); border-radius: 99px; overflow: hidden; }
.mix-bar { height: 100%; border-radius: 99px; }

.mix-num {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ink-soft);
    flex-shrink: 0;
    min-width: 62px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.care-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.care-tile {
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 13px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.care-tile .glyph { font-size: 22px; line-height: 1; }

.photo-preview {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--line);
    flex-shrink: 0;
}
.care-tile .num { font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--green-900); line-height: 1.1; }
.care-tile .lbl { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

/* ── login (sticker-book, matches the marketing site) ──────────────────── */

.login-stage {
    /* marketing-site palette, scoped to the login screen */
    --cream: #fdf6ec;
    --card-warm: #fffdf8;
    --mint: #e6f2ef;
    --teal: #164348;
    --teal-900: #0e2f33;
    --teal-bright: #2f9d94;
    --coral: #e35d5a;
    --coral-deep: #cd4744;
    --sun-deep: #eeb42c;
    --sun-soft: #fdeec3;
    --warm-line-strong: #ddccb0;
    --warm-ink: #223c3c;
    --warm-ink-soft: #566966;
    --warm-ink-mute: #8fa09b;
    --display: 'Fredoka', system-ui, 'Segoe UI', sans-serif;
    --body: 'Nunito', system-ui, 'Segoe UI', sans-serif;
    --type: 'Poppins', system-ui, 'Segoe UI', sans-serif;

    position: relative;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 26px 18px;
    gap: 20px;
    font-family: var(--body);
    background:
        radial-gradient(58% 50% at 86% 12%, var(--sun-soft), transparent 60%),
        radial-gradient(50% 46% at 8% 24%, var(--mint), transparent 60%),
        var(--cream);
}

/* floating doodles, same bob / sway / spin as the landing pages */
.login-stage .doodle { position: absolute; z-index: 0; pointer-events: none; }
.login-stage .doodle svg { display: block; width: 100%; height: auto; }

@media (prefers-reduced-motion: no-preference) {
    .login-stage .doodle { animation: login-bob 6s ease-in-out infinite; }
    .login-stage .doodle.sway { animation: login-sway 7.5s ease-in-out infinite; }
    .login-stage .doodle.twirl { animation: spin 24s linear infinite; }
    .login-stage .doodle.dly { animation-delay: -2.4s; }
    .login-stage .doodle.dly2 { animation-delay: -4.2s; }
}

@keyframes login-bob { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-16px) rotate(calc(var(--r, 0deg) + 5deg)); } }
@keyframes login-sway { 0%, 100% { transform: translateX(0) rotate(var(--r, 0deg)); } 50% { transform: translateX(15px) rotate(calc(var(--r, 0deg) - 6deg)); } }

.ld-1 { top: 12%; left: 7%;    width: 58px; color: var(--coral);       --r: -9deg; }
.ld-2 { top: 9%;  right: 9%;   width: 54px; color: var(--teal-bright); --r: 8deg; }
.ld-3 { top: 48%; left: 13%;   width: 46px; color: var(--sun-deep);    --r: 5deg; }
.ld-4 { top: 42%; right: 13%;  width: 62px; color: var(--teal);        --r: -7deg; opacity: 0.55; }
.ld-5 { bottom: 12%; left: 9%; width: 52px; color: var(--teal-bright); --r: 6deg; }
.ld-6 { bottom: 9%; right: 7%; width: 56px; color: var(--coral);       --r: -11deg; }

@media (max-width: 700px) {
    .ld-3, .ld-4 { display: none; } /* mid-height positions land on the card once it fills the width */
    .login-stage .doodle { width: 40px; }
    .ld-1 { top: 3%; left: 5%; }
    .ld-2 { top: 4%; right: 7%; }
    .ld-5 { bottom: 4%; left: 7%; }
    .ld-6 { bottom: 3%; right: 6%; }
}

.passport {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 430px;
    background: var(--card-warm);
    border-radius: 30px;
    box-shadow: 0 26px 54px -22px rgba(31, 81, 89, 0.45);
    padding: 10px;
}

.passport-frame {
    border: 2px dashed var(--warm-line-strong);
    border-radius: 22px;
    padding: 26px 32px 30px;
    color: var(--warm-ink);
    position: relative;
}

.passport .mascot { display: flex; justify-content: center; margin: -78px 0 6px; } /* sticker pops out over the card's top edge */

.passport .mascot img {
    width: 210px;
    max-width: 100%;
    aspect-ratio: 2.2 / 1; /* crop the gif's empty white margins */
    object-fit: cover;
    object-position: 50% 58%;
    border-radius: 18px;
    background: #fff; /* the gif has a white ground; frame it like a sticker */
    box-shadow: 0 8px 20px -12px rgba(31, 81, 89, 0.4);
    transform: rotate(-2deg);
}

.passport .brand-logo { display: block; width: 170px; max-width: 70%; height: auto; margin: 0 auto; }

.passport .strip {
    font-family: var(--display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--coral);
    text-align: center;
    margin: 12px 0 22px;
}

.passport .field > label {
    font-family: var(--display);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--warm-ink-soft);
}

.passport .input {
    background: #fff;
    border-color: var(--warm-line-strong);
    border-radius: 14px;
    color: var(--warm-ink);
}

.passport .input::placeholder { color: var(--warm-ink-mute); }

.passport .input:focus {
    border-color: var(--teal-bright);
    box-shadow: 0 0 0 3px rgba(47, 157, 148, 0.22);
}

.passport .btn-primary {
    width: 100%;
    font-family: var(--display);
    font-size: 16px;
    font-weight: 600;
    background: var(--coral);
    color: #fff;
    border-radius: 999px;
    box-shadow: 0 5px 0 var(--coral-deep);
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}

.passport .btn-primary:hover { background: #ea6f6a; transform: translateY(-2px); box-shadow: 0 7px 0 var(--coral-deep); }
.passport .btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--coral-deep); }

.passport .meta {
    font-size: 12.5px;
    color: var(--warm-ink-soft);
    text-align: center;
    line-height: 1.6;
}

.passport .meta strong { color: var(--warm-ink); font-weight: 700; }

.passport .linkish {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 12.5px;
    color: var(--teal-bright);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.passport .error { color: var(--coral-deep); text-align: center; }

.passport .notice {
    border: 1px dashed var(--sun-deep);
    background: var(--sun-soft);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 12.5px;
    color: var(--warm-ink);
    text-align: center;
    line-height: 1.55;
}

.login-foot {
    position: relative;
    z-index: 1;
    font-family: var(--type);
    font-size: 10px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--warm-ink-mute);
    text-align: center;
}

/* OTP boxes */
.otp-row { display: flex; gap: 8px; justify-content: center; }

.otp-box {
    width: 46px;
    height: 56px;
    text-align: center;
    font-family: var(--type);
    font-size: 24px;
    font-weight: 700;
    color: var(--teal-900);
    background: #fff;
    border: 2px solid var(--warm-line-strong);
    border-radius: 14px;
    caret-color: var(--coral);
    transition: border-color 0.12s, box-shadow 0.12s;
}

.otp-box:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(227, 93, 90, 0.2);
}

/* ── loading indicators ────────────────────────────────────────────────── */

.spin {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

[wire\:loading] .hide-loading { display: none; }

/* ── page load reveal ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
    .reveal { animation: rise 0.4s cubic-bezier(0.2, 0.8, 0.3, 1) backwards; }
    .reveal:nth-child(2) { animation-delay: 0.05s; }
    .reveal:nth-child(3) { animation-delay: 0.1s; }
    .reveal:nth-child(4) { animation-delay: 0.15s; }
    .reveal:nth-child(5) { animation-delay: 0.2s; }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* ── integration guide ─────────────────────────────────────────────────── */

.endpoint-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
    background: var(--wash);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
}

.endpoint-url {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--green-900);
    word-break: break-all;
}

.guide-steps {
    margin: 0;
    padding-left: 42px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.55;
}

.guide-steps li { padding-left: 6px; }
.guide-steps strong { color: var(--ink); font-weight: 600; }

.guide-list {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.5;
}

.guide-list li::marker { color: var(--green-600); }

/* ── layout helpers ────────────────────────────────────────────────────── */

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--ink-soft); }
.mt-0 { margin-top: 0; }

@media (max-width: 960px) {
    .shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .sidebar nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 12px; }
    .nav-label { display: none; }
    .nav-item.active::before { display: none; }
    .main { padding: 22px 18px 50px; }
    .grid-2 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
}
