/* =====================================================================
   Bientôt — the working app layer
   Native frame, live camera, toasts, form errors, info sheets, dark theme.
   Loaded after main.css; nothing here changes the light design.
   ===================================================================== */

/* ---------- inside the Expo app ---------- */
html.native {
    --status: var(--native-top, 28px);
}

html.native.statusbar-hidden {
    --status: 12px;
}

html.native body {
    background: var(--ground);
}

html.native #mobile {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

html.native,
html.native body {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

html.native input,
html.native textarea,
html.native .ticket-id,
html.native .qr-id {
    -webkit-user-select: text;
    user-select: text;
}

/* ---------- live camera: the phone's camera is drawn behind the viewport ---------- */
html.camera-live,
html.camera-live body,
html.camera-live #mobile,
html.camera-live #app,
html.camera-live .app-page.org-scanner,
html.camera-live .org-scanner-page,
html.camera-live .org-scanner-viewport {
    background: transparent !important;
}

/* the frame cuts a window in a dimmed camera picture */
html.camera-live .org-scanner-frame {
    border-radius: 24px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .42);
}

.org-scanner-viewport {
    border-radius: 0;
}

.org-scanner-frame.detected .org-scanner-corner {
    border-color: var(--switch-on);
}

.org-scanner-frame.detected .org-scanner-line {
    opacity: 0;
}

.scanner-camera-note {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 32px;
    text-align: center;
    color: #d6d6d6;
    font-size: var(--fs-body);
    line-height: 1.45;
    background: #141414;
}

.scanner-camera-note.show {
    display: flex;
}

.scanner-camera-note .ic {
    width: 28px;
    height: 28px;
    color: #8a8a8a;
}

.scanner-camera-note .spinner {
    border-color: rgba(255, 255, 255, .25);
    border-top-color: #fff;
}

.scanner-camera-note.show+.org-scanner-frame {
    opacity: .35;
}

.scanner-note-btn {
    background: #fff;
    color: #000;
    margin-top: 4px;
}

.scan-event-pick {
    color: #fff;
    border-radius: 12px;
    padding: 2px 4px;
    min-width: 0;
}

.scan-event-pick:active {
    background: #222;
}

.scan-event-pick .org-scanner-sub {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.ic-xs {
    width: 13px;
    height: 13px;
    flex: none;
}

.org-scan-card-msg {
    margin: 12px 2px 16px;
    font-size: var(--fs-body);
    color: var(--muted);
    line-height: 1.45;
}

.org-scan-card .pill-warning .ic,
.org-scan-card .pill-negative .ic {
    width: 15px;
    height: 15px;
}

/* ---------- tickets ---------- */
.qr-holder {
    margin-top: 4px;
    font-size: var(--fs-meta);
    font-weight: 600;
    color: var(--text);
}

.qr-hint {
    font-size: var(--fs-meta);
    color: var(--muted);
    text-align: center;
    line-height: 1.45;
    padding: 0 12px;
}

.qr-svg {
    border-radius: 12px;
}

.text-btn {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: var(--fs-body);
    font-weight: 500;
    color: var(--muted);
    text-align: center;
}

.text-btn.destructive {
    color: var(--negative);
}

.sched-view-row {
    gap: 14px;
}

.sched-view-time {
    min-width: 46px;
    font-weight: 600;
    font-size: var(--fs-body);
    color: var(--accent-ink);
}

/* ---------- toast ---------- */
#toast {
    position: absolute;
    left: 50%;
    bottom: calc(var(--tabbar) + 18px);
    z-index: 400;
    max-width: calc(100% - 40px);
    padding: 11px 18px;
    border-radius: 999px;
    background: var(--night);
    color: #fff;
    font-size: var(--fs-meta);
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    box-shadow: 0 8px 28px rgba(21, 26, 56, .28);
    opacity: 0;
    transform: translate(-50%, 12px);
    pointer-events: none;
    transition: opacity .25s ease, transform .35s var(--ease);
}

#toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

#toast.positive {
    background: var(--positive);
}

/* ---------- forms & auth ---------- */
.auth-error,
.sheet-error {
    min-height: 0;
    color: var(--negative);
    font-size: var(--fs-meta);
    line-height: 1.4;
}

.auth-error:not(:empty) {
    margin: 12px 4px 0;
}

.sheet-error:empty {
    display: none;
}

/* buttons under a sheet's content (delete account) */
.sheet-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.sheet-error:not(:empty) + .sheet-actions {
    margin-top: 12px;
}

/* signed in at launch: the welcome page (marked active in index.html) never paints */
html.boot-signed-in .app-page.welcomepage {
    opacity: 0;
    visibility: hidden;
}

/* sign-up date of birth: a native date picker that sits like the text fields */
.auth-input.auth-date {
    appearance: none;
    -webkit-appearance: none;
    text-align: left;
    font-family: inherit;
}

.auth-input.auth-date.empty {
    color: #8e8e93;
}

.auth-input.auth-date::-webkit-date-and-time-value {
    text-align: left;
}

.auth-input.auth-date::-webkit-calendar-picker-indicator {
    opacity: .45;
}

.auth-demo {
    margin-top: 18px;
    text-align: center;
    font-size: var(--fs-small);
    color: var(--muted);
}

/* ---------- info sheets ---------- */
.faq-item {
    display: block;
    cursor: pointer;
}

.faq-item summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: var(--fs-body);
    font-weight: 600;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    font-size: 20px;
    font-weight: 400;
    color: var(--muted);
}

.faq-item[open] summary::after {
    content: "–";
}

.faq-item p {
    margin-top: 8px;
    line-height: 1.5;
}

.legal-text {
    padding: 16px;
    font-size: var(--fs-body);
    line-height: 1.55;
    color: var(--text);
}

.legal-text p+p {
    margin-top: 12px;
}

#popup-sheet .sheet-body .form-group {
    margin-top: 0;
}

/* =====================================================================
   DARK THEME — Settings → Theme
   The night navy of the brand becomes the ground; photos and the map stay as they are.
   ===================================================================== */
html[data-theme="dark"] {
    color-scheme: dark;
    --ground: var(--brand-ground-dark);
    --surface: #181c33;
    --raised: #1e2340;
    --fill: #252a48;
    --fill-press: #2f3557;
    --separator: #2a2f4e;
    --control: #4a5078;

    --text: #eceef8;
    --muted: #9ca1bf;
    --primary: #5563d6;
    --primary-hover: #6471e0;
    --night: #1d2350;
    --night-2: #283066;
    --on-night-muted: #b6bbd8;

    --accent-ink: var(--brand-coral-on-dark);
    --accent-soft: #3b2219;

    --cat-hackathon-bg: #3a1c22;  --cat-hackathon-ink: #ff9fa3;
    --cat-conference-bg: #1b2650; --cat-conference-ink: #a9bcff;
    --cat-meetup-bg: #14342a;     --cat-meetup-ink: #87dcb6;
    --cat-fair-bg: #3a2c10;       --cat-fair-ink: #f2c66d;

    --positive: #4cc27a;
    --pill-positive-bg: #163524;
    --pill-positive-ink: #9be7b6;
    --negative: #ff6b6f;
    --pill-negative-bg: #3c1b1d;
    --pill-negative-ink: #ffb1ae;
    --pill-warning-bg: #3a2a10;
    --pill-warning-ink: #f5c77a;
    --pill-neutral-bg: #262b4a;
    --pill-neutral-ink: #c9cce0;
    --switch-on: #2bb37c;
}

html[data-theme="dark"] body {
    background: var(--ground);
}

html[data-theme="dark"] .scrolled .nav-bar,
html[data-theme="dark"] .nav-bar.solid,
html[data-theme="dark"] .scrolled-far .ev-compact {
    background: rgba(13, 16, 34, .97);
}

html[data-theme="dark"] .ev-bar,
html[data-theme="dark"] .event-bottom-bar {
    background: rgba(13, 16, 34, .97);
    box-shadow: 0 -1px 0 var(--separator);
}

html[data-theme="dark"] .switch {
    background: #3a3f62;
}

html[data-theme="dark"] .switch.active {
    background: var(--switch-on);
}

html[data-theme="dark"] .bottom-nav-item {
    color: #8a8fae;
}

html[data-theme="dark"] .bottom-nav-item.active {
    color: #c3c9ff;
}

html[data-theme="dark"] .bottom-nav-item.active .ic {
    background: #283066;
}

/* things that sit on photographs keep their light chips */
html[data-theme="dark"] .glass-btn {
    color: #14182e;
}

html[data-theme="dark"] .feature-media .pill,
html[data-theme="dark"] .pass-media .pill,
html[data-theme="dark"] .pill.on-media {
    color: #14182e;
}

html[data-theme="dark"] .map-preview,
html[data-theme="dark"] .fullmap-canvas {
    filter: brightness(.86) saturate(.9);
}

html[data-theme="dark"] .btn-primary:disabled {
    opacity: .5;
}

html[data-theme="dark"] #popup-overlay.active {
    background: rgba(0, 0, 0, .55);
}

html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"] {
    color-scheme: dark;
}

html[data-theme="dark"] #toast {
    background: #eceef8;
    color: #14182e;
}

html[data-theme="dark"] #toast.positive {
    background: #2bb37c;
    color: #fff;
}

/* ==================== text that must fit at 360 px in EN / RU / UZ (UI audit 2026-11-21) ==================== */

/* settings: a label may take two lines; the value beside it (a name) gives way first */
.settings-item .settings-item-title,
.settings-item .row-sub {
    white-space: normal;
}
.settings-item .row-value {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* help: a question is read whole */
.faq-item summary.row-title {
    white-space: normal;
}

/* dialogs: two buttons side by side while they fit, one under the other when a label is long */
.dialog .dialog-actions {
    flex-wrap: wrap;
}
.dialog .dialog-actions .btn {
    flex: 1 0 auto;
    min-width: 40%;
    white-space: nowrap;
}

/* category pills over an event: next line rather than off the screen */
.ev-kind {
    flex-wrap: wrap;
    row-gap: 6px;
}
.ev-kind .pill.cat-h + .pill.cat-h {
    margin-left: 0;
}

/* stat labels under a number: up to two even lines */
.stat-label {
    line-height: 1.25;
    overflow-wrap: break-word;
}
