/* ==========================================================================
   BeerHere design system
   ========================================================================== */

:root {
    --amber-50: #fff8e6;
    --amber-100: #ffefc2;
    --amber-300: #ffcf5c;
    --amber-500: #f5a623;
    --amber-600: #dc8a0b;
    --amber-700: #b06906;
    --stout-900: #1f1610;
    --stout-800: #2d2018;
    --stout-700: #4a382b;

    --bg: #fbf6ec;
    --bg-elev: #ffffff;
    --bg-sunken: #f3ead8;
    --ink: #2a1f17;
    --ink-soft: #6b5a4a;
    --line: #e9dec9;
    --primary: var(--amber-500);
    --primary-hover: var(--amber-600);
    --on-primary: #2a1a05;
    --danger: #c0392b;
    --success: #2f8f4e;

    --radius-sm: .5rem;
    --radius: .9rem;
    --radius-lg: 1.4rem;
    --shadow-sm: 0 1px 2px rgba(60, 35, 10, .08);
    --shadow: 0 6px 18px rgba(60, 35, 10, .10);
    --shadow-lg: 0 14px 36px rgba(60, 35, 10, .16);
    --ring: 0 0 0 3px rgba(245, 166, 35, .35);

    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --nav-h: 4.1rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #17110c;
        --bg-elev: #231a13;
        --bg-sunken: #1c140e;
        --ink: #f4e9d8;
        --ink-soft: #b7a58f;
        --line: #3a2c20;
        --primary: #f5b13d;
        --primary-hover: #ffc35e;
        --danger: #ec6a5c;
        --success: #5cc47e;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow: 0 6px 18px rgba(0, 0, 0, .45);
        --shadow-lg: 0 14px 36px rgba(0, 0, 0, .55);
    }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ink);
    background:
        radial-gradient(60rem 30rem at 50% -10rem, color-mix(in srgb, var(--amber-300) 28%, transparent), transparent 70%),
        var(--bg);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6rem; letter-spacing: -.015em; }
h1 { font-size: 1.85rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .8rem; }

a { color: var(--amber-700); text-underline-offset: 2px; }
@media (prefers-color-scheme: dark) { a { color: var(--primary); } }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

h1:focus { outline: none; }

/* ---------- Layout ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem 1rem;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -.02em;
    color: var(--ink);
    text-decoration: none;
}
.brand__logo {
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: .7rem;
    background: linear-gradient(145deg, var(--amber-300), var(--amber-600));
    box-shadow: var(--shadow-sm);
    font-size: 1.15rem;
}

.topnav { display: none; gap: .25rem; align-items: center; }
.topnav a, .topnav .linkbtn {
    padding: .45rem .8rem;
    border-radius: 999px;
    color: var(--ink-soft);
    font-weight: 600;
    text-decoration: none;
}
.topnav a:hover, .topnav .linkbtn:hover { background: var(--bg-sunken); color: var(--ink); }
.topnav a.active { background: var(--amber-100); color: var(--amber-700); }
@media (prefers-color-scheme: dark) { .topnav a.active { background: #3a2a14; color: var(--primary); } }

.topbar__right { display: flex; align-items: center; gap: .5rem; }
.topbar form, .topnav form { margin: 0; }

.content {
    max-width: 44rem;
    margin: 0 auto;
    padding: 1.25rem 1rem calc(var(--nav-h) + 2rem);
}

/* Bottom tab bar (mobile) */
.tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 50;
    height: var(--nav-h);
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
}
.tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .1rem;
    font-size: .72rem;
    font-weight: 700;
    color: var(--ink-soft);
    text-decoration: none;
}
.tabbar a span:first-child { font-size: 1.4rem; line-height: 1; filter: grayscale(.7); transition: transform .15s; }
.tabbar a.active { color: var(--amber-700); }
.tabbar a.active span:first-child { filter: none; transform: translateY(-2px) scale(1.1); }
@media (prefers-color-scheme: dark) { .tabbar a.active { color: var(--primary); } }

@media (min-width: 720px) {
    .topnav { display: flex; }
    .tabbar { display: none; }
    .content { padding-bottom: 3rem; }
    h1 { font-size: 2.1rem; }
}

/* ---------- Cards ---------- */

.card {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}
.card > :last-child { margin-bottom: 0; }
.card__title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.card__title h2 { margin: 0; }

.page-head { margin-bottom: 1.1rem; }
.page-head p { color: var(--ink-soft); margin: 0; }

/* ---------- Hero ---------- */

.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 2rem 1.4rem 1.8rem;
    margin-bottom: 1.25rem;
    color: #fff7e8;
    background:
        radial-gradient(18rem 12rem at 90% 0%, rgba(255, 207, 92, .55), transparent 70%),
        linear-gradient(160deg, var(--stout-800), var(--stout-900));
    box-shadow: var(--shadow-lg);
}
.hero h1 { color: #fff; font-size: 2.1rem; margin-bottom: .5rem; }
.hero p { color: #e8d6bb; max-width: 30rem; font-size: 1.05rem; }
.hero__glass { position: absolute; right: -.4rem; bottom: -1.2rem; font-size: 8.5rem; opacity: .16; transform: rotate(14deg); pointer-events: none; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; position: relative; }
.hero .btn--ghost { color: #fff7e8; border-color: rgba(255, 247, 232, .35); }
.hero .btn--ghost:hover { background: rgba(255, 255, 255, .12); }

.features { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.feature { padding: 1rem; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.feature__icon { font-size: 1.6rem; display: block; margin-bottom: .3rem; }
.feature h3 { margin-bottom: .2rem; }
.feature p { color: var(--ink-soft); margin: 0; font-size: .92rem; }

/* ---------- Buttons ---------- */

.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .62rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    color: var(--on-primary);
    background: linear-gradient(180deg, var(--amber-300), var(--primary));
    box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, var(--shadow-sm);
    cursor: pointer;
    text-decoration: none;
    transition: transform .08s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover, button:hover { filter: brightness(1.05); box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, var(--shadow); }
.btn:active, button:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: default; transform: none; filter: none; }

button.secondary, .btn--secondary {
    color: var(--ink);
    background: var(--bg-sunken);
    border-color: var(--line);
    box-shadow: none;
}
button.secondary:hover, .btn--secondary:hover { background: var(--amber-100); }
@media (prefers-color-scheme: dark) { button.secondary:hover, .btn--secondary:hover { background: #33261a; } }

button.danger {
    color: #fff;
    background: var(--danger);
    box-shadow: none;
}
.btn--ghost { color: var(--ink); background: transparent; border-color: var(--line); box-shadow: none; }
.btn--ghost:hover { background: var(--bg-sunken); }
.btn--sm, button.sm { padding: .38rem .8rem; font-size: .88rem; }

button.linkbtn, .linkbtn {
    background: none;
    border: 0;
    box-shadow: none;
    color: var(--ink-soft);
    padding: .45rem .8rem;
}
button.linkbtn:hover { filter: none; box-shadow: none; }

/* ---------- Forms ---------- */

label { display: block; font-weight: 700; font-size: .9rem; margin: .9rem 0 .3rem; }
label.check { display: flex; align-items: center; gap: .55rem; font-weight: 600; margin: .8rem 0; cursor: pointer; }

input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local],
input[type=search], input:not([type]), select, textarea {
    width: 100%;
    padding: .7rem .9rem;
    font: inherit;
    color: var(--ink);
    background: var(--bg-elev);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input::placeholder { color: color-mix(in srgb, var(--ink-soft) 70%, transparent); }
input[type=checkbox] { width: 1.15rem; height: 1.15rem; accent-color: var(--amber-600); }

.field-hint { color: var(--ink-soft); font-size: .82rem; }

.validation-message, .error { color: var(--danger); font-size: .88rem; font-weight: 600; margin: .3rem 0 0; }
input.invalid { border-color: var(--danger); }
.success { color: var(--success); font-weight: 600; }

/* ---------- Toasts / alerts ---------- */

.toast {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    animation: pop .25s ease;
}
.toast--ok { background: color-mix(in srgb, var(--success) 14%, var(--bg-elev)); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 40%, transparent); }
.toast--err { background: color-mix(in srgb, var(--danger) 12%, var(--bg-elev)); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }

@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Misc elements ---------- */

.muted { color: var(--ink-soft); }
.small { font-size: .82rem; }

.badge {
    display: inline-block;
    padding: .08rem .55rem;
    margin-left: .35rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .02em;
    color: var(--amber-700);
    background: var(--amber-100);
    vertical-align: middle;
}
@media (prefers-color-scheme: dark) { .badge { color: var(--primary); background: #3a2a14; } }

.chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .65rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    background: var(--bg-sunken);
    color: var(--ink-soft);
}
.chip--going { background: color-mix(in srgb, var(--success) 16%, var(--bg-elev)); color: var(--success); }

.avatar {
    --hue: 35;
    flex: none;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(145deg, hsl(var(--hue) 70% 58%), hsl(calc(var(--hue) + 20) 70% 42%));
    box-shadow: var(--shadow-sm);
    user-select: none;
}
.avatar--sm { width: 1.7rem; height: 1.7rem; font-size: .75rem; }

.empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--ink-soft);
    border: 2px dashed var(--line);
    border-radius: var(--radius);
}
.empty__icon { display: block; font-size: 2.4rem; margin-bottom: .3rem; }

/* People rows */
.row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 0;
    border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row__main { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Ping card ---------- */

.ping {
    display: flex;
    gap: .9rem;
    padding: 1rem;
    margin-bottom: .9rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
}
.ping:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.ping--mine { border-left: 5px solid var(--primary); }

.datebox {
    flex: none;
    width: 3.7rem;
    text-align: center;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-elev);
    align-self: flex-start;
}
.datebox__month { display: block; padding: .12rem 0; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--on-primary); background: var(--primary); }
.datebox__day { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1.15; padding-top: .1rem; }
.datebox__time { display: block; font-size: .78rem; font-weight: 700; color: var(--ink-soft); padding-bottom: .25rem; }

.ping__body { flex: 1; min-width: 0; }
.ping__venue { margin: 0; }
.ping__meta { display: flex; align-items: center; gap: .4rem; color: var(--ink-soft); font-size: .88rem; margin: .15rem 0 .5rem; }
.ping__msg { margin: .2rem 0 .6rem; padding: .5rem .75rem; border-radius: var(--radius-sm); background: var(--bg-sunken); font-style: italic; }
.ping__who { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .7rem; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg-sunken); }
.seg button {
    border-radius: 0;
    background: transparent;
    color: var(--ink-soft);
    box-shadow: none;
    padding: .45rem .85rem;
    font-size: .88rem;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--primary); color: var(--on-primary); }
.seg button.on.no { background: var(--ink-soft); color: var(--bg); }

/* ---------- Auth ---------- */

.auth { max-width: 26rem; margin: 1.5rem auto 0; }
.auth .card { padding: 1.5rem; box-shadow: var(--shadow); }
.auth .btn-block, .auth button[type=submit] { width: 100%; padding: .8rem; margin-top: .4rem; }
.auth__alt { text-align: center; color: var(--ink-soft); margin-top: 1rem; }

/* ---------- Blazor error UI ---------- */

#blazor-error-ui { display: none; }

/* ==========================================================================
   Map-first home (BarMap)
   ========================================================================== */

:root { --topbar-h: 3.75rem; }

body:has(.mapview) { overflow: hidden; }

.mapview {
    position: fixed;
    inset: var(--topbar-h) 0 var(--nav-h) 0;
    isolation: isolate;
    background: var(--bg-sunken);
}
@media (min-width: 720px) { .mapview { inset: var(--topbar-h) 0 0 0; } }

.mapview__map { position: absolute; inset: 0; z-index: 0; }

.mapview__top {
    position: absolute;
    z-index: 1100;
    top: .75rem;
    left: .75rem;
    right: .75rem;
    max-width: 30rem;
    display: grid;
    gap: .5rem;
    pointer-events: none;
}
.mapview__top > * { pointer-events: auto; }

.searchbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .25rem .5rem .25rem .9rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow);
}
.searchbar input { border: 0; box-shadow: none; background: transparent; padding: .55rem .2rem; }
.searchbar input:focus { box-shadow: none; }

.chips-row { display: flex; gap: .4rem; }
.filterchip {
    padding: .38rem .85rem;
    font-size: .85rem;
    color: var(--ink);
    background: var(--bg-elev);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.filterchip.on { color: var(--on-primary); background: var(--primary); border-color: var(--primary); }

.mapview__locate {
    position: absolute;
    z-index: 1100;
    right: .75rem;
    bottom: 6.6rem;
    width: 2.9rem;
    height: 2.9rem;
    padding: 0;
    border-radius: 50%;
    font-size: 1.3rem;
    color: var(--ink);
    background: var(--bg-elev);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.mapview__status {
    position: absolute;
    z-index: 1100;
    left: 50%;
    bottom: 1.2rem;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: .6rem;
    max-width: calc(100% - 1.5rem);
    padding: .55rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .9rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.mapview__status--err { color: var(--danger); }

.mapview__toast { position: absolute; z-index: 1200; top: 7.5rem; left: .75rem; right: .75rem; max-width: 30rem; margin: 0; box-shadow: var(--shadow); }

/* Bar markers: beer icon, with the name next to it when zoomed in enough */
.pin {
    display: flex;
    align-items: center;
    gap: .3rem;
    width: max-content;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    cursor: pointer;
}
.pin:hover { filter: none; box-shadow: none; }
.pin__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 17px;
    line-height: 1;
    background: #fff;
    border: 2px solid #b8a487;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
    transition: transform .12s;
}
.pin--beer .pin__icon { background: var(--amber-300); border-color: var(--amber-700); }
.pin--selected .pin__icon { transform: scale(1.25); border-color: var(--stout-900); box-shadow: 0 0 0 4px rgba(245, 166, 35, .55), 0 2px 8px rgba(0, 0, 0, .4); }
.pin__label {
    display: none;
    pointer-events: none;
    max-width: 11rem;
    padding: .1rem .55rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .76rem;
    font-weight: 800;
    color: #2a1f17;
    background: rgba(255, 255, 255, .95);
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.pin--label .pin__label { display: block; }
.pin:hover { z-index: 5000 !important; }
.pin:hover .pin__label { display: block; }

.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #2f7bf5; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47, 123, 245, .25); }

.maplibregl-ctrl-bottom-right { margin-bottom: 5.8rem; }
@media (min-width: 720px) { .maplibregl-ctrl-bottom-right { margin-bottom: 0; } }

/* Bottom sheet for the selected bar */
.sheet {
    position: absolute;
    z-index: 1200;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 78%;
    overflow-y: auto;
    padding: 1.1rem 1.1rem 1.4rem;
    background: var(--bg-elev);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .22);
    animation: slideup .22s ease;
}
@media (min-width: 720px) {
    .sheet { left: auto; right: 1rem; bottom: 1rem; width: 25rem; border-radius: var(--radius-lg); }
    .mapview__locate { bottom: 1rem; right: 27rem; }
    .maplibregl-ctrl-bottom-right { margin-right: 25rem; }
}
.sheet__close { position: absolute; top: .7rem; right: .7rem; width: 2rem; height: 2rem; padding: 0; color: var(--ink); background: var(--bg-sunken); box-shadow: none; }
.sheet__title { margin: 0 2.4rem .15rem 0; }
.sheet__form { margin-top: .6rem; }
.sheet__grid > * { min-width: 0; }
.sheet__grid { display: grid; gap: .6rem; grid-template-columns: 1fr; }
@media (min-width: 420px) { .sheet__grid { grid-template-columns: 1fr 1fr; } }
.sheet__send { width: 100%; margin-top: .9rem; padding: .8rem; }

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

.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { z-index: 30; }
.maplibregl-ctrl-attrib { font-size: .7rem; }
