/* ==========================================================================
   Burza učebnic PSJG — "Bento" redesign
   Plovoucí prosklená navigace · aurora pozadí · bento mřížka · velká typografie
   Světlý i automatický tmavý režim (prefers-color-scheme).
   ========================================================================== */

/* ------------------------------------------------------------------ Tokens */
:root {
  color-scheme: light;

  --brand: #6d5efc;
  --brand-strong: #5b4ef0;
  --brand-ink: #4a3fd0;
  --brand-2: #a855f7;
  --brand-3: #ec4899;

  --accent: #0a9d6e;          /* ceny / nabídky */
  --accent-soft: rgba(10, 157, 110, 0.12);
  --accent-ink: #07815a;

  --info-soft: rgba(109, 94, 252, 0.13);
  --info-ink: #5346cf;

  --warn-soft: rgba(217, 119, 6, 0.14);
  --warn-ink: #9a5b08;

  --danger: #e23b54;
  --danger-soft: rgba(226, 59, 84, 0.12);
  --danger-ink: #c01f3c;

  --bg: #f1f0fa;
  --bg-2: #eceaf7;
  --text: #161427;
  --text-muted: #5d5876;
  --text-subtle: #8a85a1;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.66);
  --glass-bg-strong: rgba(255, 255, 255, 0.86);
  --glass-border: rgba(22, 18, 50, 0.08);
  --glass-hi: rgba(255, 255, 255, 0.9);
  --field-bg: rgba(255, 255, 255, 0.7);

  --hero-grad: linear-gradient(135deg, #6d5efc 0%, #8b5cf6 42%, #d946ef 100%);
  --brand-grad: linear-gradient(135deg, #6d5efc, #a855f7);
  --num-grad: linear-gradient(135deg, #6d5efc, #c026d3);

  --shadow-glass: 0 12px 34px rgba(28, 22, 70, 0.1), 0 2px 8px rgba(28, 22, 70, 0.05);
  --shadow-lift: 0 22px 52px rgba(28, 22, 70, 0.16), 0 6px 16px rgba(28, 22, 70, 0.08);
  --shadow-glow: 0 24px 60px rgba(124, 80, 240, 0.34);
  --ring: 0 0 0 3px rgba(124, 109, 250, 0.32);

  --r-xs: 9px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  --aurora-1: #7c6dff;
  --aurora-2: #e879f9;
  --aurora-3: #22d3ee;
  --aurora-opacity: 0.55;

  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d5876' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --brand: #8b7dff;
    --brand-strong: #7b6cff;
    --brand-ink: #b3a8ff;
    --brand-2: #c084fc;
    --brand-3: #f472b6;

    --accent: #2dd4a7;
    --accent-soft: rgba(45, 212, 167, 0.16);
    --accent-ink: #5eead4;

    --info-soft: rgba(139, 125, 255, 0.18);
    --info-ink: #c4baff;

    --warn-soft: rgba(251, 191, 36, 0.16);
    --warn-ink: #fcd34d;

    --danger: #ff6b81;
    --danger-soft: rgba(255, 107, 129, 0.16);
    --danger-ink: #ff9aa8;

    --bg: #08070f;
    --bg-2: #0c0a17;
    --text: #f0eefb;
    --text-muted: #aaa4c6;
    --text-subtle: #7f7a9b;

    --glass-bg: rgba(255, 255, 255, 0.045);
    --glass-bg-strong: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hi: rgba(255, 255, 255, 0.16);
    --field-bg: rgba(255, 255, 255, 0.05);

    --hero-grad: linear-gradient(135deg, #5b4ef0 0%, #7c3aed 45%, #be1d97 100%);
    --brand-grad: linear-gradient(135deg, #7b6cff, #c084fc);
    --num-grad: linear-gradient(135deg, #a89bff, #e879f9);

    --shadow-glass: 0 18px 48px rgba(0, 0, 0, 0.5);
    --shadow-lift: 0 28px 64px rgba(0, 0, 0, 0.62);
    --shadow-glow: 0 28px 70px rgba(110, 70, 240, 0.5);
    --ring: 0 0 0 3px rgba(139, 125, 255, 0.4);

    --aurora-opacity: 0.42;

    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aaa4c6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  }
}

/* ------------------------------------------------------------------- Reset */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--brand-ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(124, 109, 250, 0.26);
}

button,
input,
select,
textarea {
  font: inherit;
}

/* ------------------------------------------------------------------ Aurora */
.aurora {
  position: fixed;
  inset: -20vmax;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.aurora-blob {
  position: absolute;
  width: 58vmax;
  height: 58vmax;
  border-radius: 50%;
  opacity: var(--aurora-opacity);
  filter: blur(72px);
  will-change: transform;
}

.aurora-1 {
  top: -8vmax;
  left: -6vmax;
  background: radial-gradient(circle at 50% 50%, var(--aurora-1), transparent 62%);
  animation: drift-a 38s ease-in-out infinite;
}

.aurora-2 {
  top: -12vmax;
  right: -10vmax;
  background: radial-gradient(circle at 50% 50%, var(--aurora-2), transparent 62%);
  animation: drift-b 46s ease-in-out infinite;
}

.aurora-3 {
  bottom: -16vmax;
  left: 28%;
  background: radial-gradient(circle at 50% 50%, var(--aurora-3), transparent 62%);
  animation: drift-c 52s ease-in-out infinite;
}

@keyframes drift-a {
  50% { transform: translate(8vmax, 6vmax) scale(1.1); }
}
@keyframes drift-b {
  50% { transform: translate(-7vmax, 5vmax) scale(1.08); }
}
@keyframes drift-c {
  50% { transform: translate(5vmax, -7vmax) scale(1.12); }
}

/* ------------------------------------------------------------- Glass cards */
.bento-stat,
.filters-band,
.listing-card,
.auth-panel,
.profile-card,
.settings-card,
.detail-media,
.detail-summary,
.detail-facts,
.contact-box,
.description,
.qr-box,
.interaction-box,
.admin-row,
.empty-state,
.metrics-strip div,
.listing-form fieldset,
.tabs,
.account-facts,
.reservation-row,
.message-row {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

/* --------------------------------------------------------------- Controls */
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  background: var(--field-bg);
  color: var(--text);
  padding: 0.72rem 0.9rem;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-subtle);
}

textarea {
  resize: vertical;
  min-height: 5.5rem;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 1.1rem;
  cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}

button:focus-visible,
a:focus-visible,
.button:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* ------------------------------------------------------------------- Nav */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: clamp(0.6rem, 1.6vw, 1rem) clamp(0.7rem, 3vw, 1.5rem);
}

.topnav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0.5rem 0.6rem 0.5rem 0.85rem;
  border-radius: var(--r-pill);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
}

.brand {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  color: var(--text);
  font-weight: 750;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-grad);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: var(--shadow-glow);
}

.brand-name {
  overflow: hidden;
  max-width: 42vw;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  justify-self: center;
  gap: 0.15rem;
  min-width: 0;
}

.nav-links a {
  padding: 0.5rem 0.95rem;
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  transition: background 130ms ease, color 130ms ease;
}

.nav-links a:hover {
  background: var(--glass-bg);
  color: var(--text);
  text-decoration: none;
}

.nav-links a.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 13rem;
  padding: 0.3rem 0.7rem 0.3rem 0.35rem;
  border-radius: var(--r-pill);
  color: var(--text);
  font-weight: 600;
}

.account-chip:hover {
  background: var(--glass-bg);
  text-decoration: none;
}

.account-avatar {
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-grad);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ Shell */
.shell {
  width: min(1180px, 100% - 2rem);
  margin: 0 auto;
  padding: 0.4rem 0 5rem;
}

.page {
  display: block;
}

/* --------------------------------------------------------------- Buttons */
.button {
  display: inline-flex;
  min-height: 2.7rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 0.62rem 1.3rem;
  cursor: pointer;
  font-weight: 650;
  letter-spacing: -0.005em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 150ms ease, box-shadow 170ms ease, background 150ms ease,
    border-color 150ms ease, filter 150ms ease;
}

.button:hover {
  text-decoration: none;
}

.button:active {
  transform: translateY(1px) scale(0.99);
}

.button-primary {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.button-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 26px 60px rgba(124, 80, 240, 0.45);
}

.button-light {
  background: #fff;
  color: var(--brand-ink);
  box-shadow: 0 12px 26px rgba(20, 12, 60, 0.22);
}

.button-light:hover {
  filter: brightness(0.97);
  transform: translateY(-2px);
}

.button-glass {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.button-glass:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

.button-secondary {
  background: var(--info-soft);
  border-color: var(--glass-border);
  color: var(--brand-ink);
}

.button-secondary:hover {
  border-color: var(--brand);
}

.button-ghost {
  background: var(--glass-bg-strong);
  border-color: var(--glass-border);
  color: var(--text);
}

.button-ghost:hover {
  border-color: var(--brand);
}

.button-danger {
  background: var(--glass-bg-strong);
  border-color: color-mix(in srgb, var(--danger) 50%, var(--glass-border));
  color: var(--danger);
}

.button:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.button-danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}

.button-google {
  width: 100%;
  margin-top: 1rem;
  background: var(--glass-bg-strong);
  border-color: var(--glass-border);
  color: var(--text);
}

.button-google:hover {
  border-color: var(--brand);
}

/* --------------------------------------------------------------- Kicker */
.kicker,
.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--brand-ink);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.kicker-on-dark {
  color: rgba(255, 255, 255, 0.82);
}

/* ----------------------------------------------------------------- Bento */
.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(104px, auto);
  gap: clamp(0.6rem, 1.25vw, 0.85rem);
  margin-bottom: clamp(0.75rem, 1.6vw, 1.05rem);
}

.bento-hero {
  position: relative;
  grid-column: span 2;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: clamp(1.25rem, 2.45vw, 2.05rem);
  background: var(--hero-grad);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.bento-hero::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(26rem 16rem at 92% -20%, rgba(255, 255, 255, 0.28), transparent 60%),
    radial-gradient(22rem 18rem at -5% 120%, rgba(255, 255, 255, 0.16), transparent 55%);
}

.bento-hero > * {
  position: relative;
  z-index: 1;
}

.bento-hero h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3.05vw, 2.82rem);
  font-weight: 820;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.bento-hero h1 span {
  color: rgba(255, 255, 255, 0.66);
}

.hero-sub {
  margin: 0.78rem 0 0;
  max-width: 34ch;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(0.9rem, 1.02vw, 0.98rem);
}

.hero-cta {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.bento-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.18rem;
  border-radius: var(--r-lg);
  padding: clamp(0.85rem, 1.3vw, 1.08rem);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.bento-stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--glass-border));
}

.stat-num {
  font-size: clamp(1.68rem, 2.55vw, 2.42rem);
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1;
  background: var(--num-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

/* --------------------------------------------------------------- Filters */
.filters-band {
  border-radius: var(--r-lg);
  padding: clamp(0.9rem, 1.8vw, 1.25rem);
  margin-bottom: clamp(1.4rem, 2.6vw, 1.9rem);
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) repeat(3, minmax(130px, 1fr)) auto;
  gap: 0.8rem;
  align-items: end;
}

label span {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.filters .button {
  min-height: 2.85rem;
}

/* ------------------------------------------------------------ Catalog head */
.catalog-head,
.toolbar,
.section-heading,
.section-title {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0 0 1.2rem;
}

.catalog-head h2,
.section-title h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2.2vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.catalog-head .kicker {
  margin: 0;
  color: var(--text-subtle);
}

.toolbar h1,
.section-heading h1,
.auth-panel h1,
.detail-main h1,
.profile-card h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  font-weight: 820;
  letter-spacing: -0.03em;
  line-height: 1.06;
}

.tight-title {
  margin-bottom: 0.6rem;
}

.page-heading {
  margin-bottom: 1.5rem;
}

.form-page-heading {
  align-items: center;
}

.form-page-heading .eyebrow {
  margin: 0;
}

/* ----------------------------------------------------------- Listing grid */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: clamp(0.9rem, 1.6vw, 1.15rem);
  align-items: stretch;
}

.listing-card {
  display: grid;
  grid-template-rows: 168px 1fr;
  min-height: 100%;
  overflow: hidden;
  border-radius: var(--r-lg);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.listing-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--glass-border));
}

.listing-photo {
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 0.7rem 0.7rem 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  background: transparent;
}

.listing-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
}

.listing-content {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem;
}

.listing-meta {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ------------------------------------------------------------------ Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  min-height: 1.6rem;
  border-radius: var(--r-pill);
  padding: 0.18rem 0.66rem;
  font-size: 0.74rem;
  font-weight: 750;
}

.pill::before {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.pill-offer {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.pill-request {
  background: var(--info-soft);
  color: var(--info-ink);
}

.pill-muted {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.pill-closed {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

/* --------------------------------------------------------------- Card text */
.listing-card h2,
.admin-row h2,
.description h2,
.contact-box h2,
.qr-box h2,
.interaction-box h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 760;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.listing-card h2 a,
.admin-row h2 a {
  color: var(--text);
}

.listing-card h2 a:hover,
.admin-row h2 a:hover {
  color: var(--brand-ink);
  text-decoration: none;
}

.facts,
.detail-facts {
  display: grid;
  gap: 0.65rem;
  margin: 0;
}

.facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.facts div,
.detail-facts div {
  min-width: 0;
}

dt {
  color: var(--text-subtle);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.listing-bottom {
  display: flex;
  gap: 0.8rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: auto;
  border-top: 1px solid var(--glass-border);
  padding-top: 0.78rem;
}

.condition {
  display: grid;
  gap: 0.04rem;
  min-width: 0;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
}

.condition small {
  color: var(--text-subtle);
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  line-height: 0.85;
  text-transform: uppercase;
}

.condition span {
  line-height: 1.05;
}

.listing-price {
  font-size: 1.4rem;
  font-weight: 850;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--accent);
}

/* ------------------------------------------------------------- Empty state */
.empty-state {
  grid-column: 1 / -1;
  border-radius: var(--r-lg);
  padding: 3.2rem 2.4rem;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 0.4rem;
  font-size: 1.3rem;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.empty-state p {
  margin: 0;
  color: var(--text-muted);
}

.compact-empty {
  padding: 1.3rem;
  text-align: left;
}

/* ------------------------------------------------------------------ Flash */
.flash {
  margin: 1rem 0 0;
  border-radius: var(--r-md);
  border: 1px solid var(--glass-border);
  padding: 0.9rem 1.2rem;
  font-weight: 600;
  box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.flash-success {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  color: var(--accent-ink);
}

.flash-error,
.form-errors {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 38%, transparent);
  color: var(--danger-ink);
}

.form-errors {
  border: 1px solid color-mix(in srgb, var(--danger) 38%, transparent);
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  padding: 0.9rem 1.2rem;
}

.form-errors p {
  margin: 0.2rem 0;
  font-weight: 600;
}

/* ------------------------------------------------------------------- Auth */
.auth-shell {
  display: grid;
  min-height: 66vh;
  place-items: center;
  padding: 1.5rem 0;
}

.auth-panel {
  width: min(440px, 100%);
  border-radius: var(--r-xl);
  padding: 2rem;
}

.auth-panel h1 {
  margin-bottom: 0.5rem;
}

.auth-copy,
.field-hint {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.auth-copy {
  margin-bottom: 1.1rem;
}

.field-hint {
  margin-top: -0.65rem;
  font-size: 0.86rem;
}

.code-input {
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-align: center;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.85rem;
  align-items: center;
  margin: 1.15rem 0 0;
  color: var(--text-subtle);
  font-size: 0.8rem;
  font-weight: 650;
}

.divider::before,
.divider::after {
  height: 1px;
  background: var(--glass-border);
  content: "";
}

/* ---------------------------------------------------------------- Account */
.account-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: 1.2rem;
  align-items: stretch;
  width: min(980px, 100%);
  margin: 0 auto;
}

.profile-card,
.settings-card {
  border-radius: var(--r-xl);
  padding: 1.6rem;
}

.account-facts {
  display: grid;
  gap: 0.75rem;
  margin: 1.1rem 0 0;
  border-radius: var(--r-md);
  padding: 1.1rem;
}

.account-facts div {
  display: grid;
  gap: 0.2rem;
}

.account-facts dd {
  font-size: 1rem;
}

/* ------------------------------------------------------------------ Forms */
.stack-form,
.listing-form {
  display: grid;
  gap: 1.1rem;
}

.stack-form {
  margin-top: 1.2rem;
}

.form-shell {
  width: min(880px, 100%);
  margin: 0 auto;
}

.listing-form fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  margin: 0;
  border-radius: var(--r-lg);
  padding: 1.5rem;
}

.form-group-title {
  grid-column: 1 / -1;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 760;
  letter-spacing: -0.01em;
}

.wide {
  grid-column: 1 / -1;
}

.form-actions,
.owner-actions,
.inline-form {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

.current-photo {
  display: grid;
  gap: 0.5rem;
}

.current-photo span {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.current-photo img {
  width: min(220px, 100%);
  aspect-ratio: 4 / 3;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  object-fit: cover;
}

/* ----------------------------------------------------------------- Detail */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
  gap: 1.4rem;
  align-items: start;
}

.detail-media {
  position: sticky;
  top: 90px;
  overflow: hidden;
  min-height: 380px;
  border-radius: var(--r-xl);
}

.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-media img.placeholder-image {
  object-fit: contain;
  padding: 1.6rem;
}

.detail-main {
  display: grid;
  gap: 1.1rem;
}

.detail-summary {
  display: grid;
  gap: 1rem;
  border-radius: var(--r-lg);
  padding: 1.3rem;
}

.detail-summary .listing-meta {
  margin-bottom: -0.15rem;
}

.detail-summary .detail-facts {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.detail-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem 1.15rem;
  border-radius: var(--r-lg);
  padding: 1.3rem;
}

.detail-facts dd {
  font-size: 1.02rem;
}

.description,
.contact-box,
.qr-box,
.interaction-box {
  border-radius: var(--r-lg);
  padding: 1.3rem;
}

.description p {
  margin: 0.4rem 0 0;
  white-space: pre-line;
}

.contact-box p {
  margin: 0.3rem 0;
}

.contact-box a {
  font-weight: 650;
}

.qr-box {
  display: flex;
  gap: 1.1rem;
  align-items: center;
  justify-content: space-between;
}

.qr-box p,
.interaction-box p {
  margin: 0.25rem 0;
  color: var(--text-muted);
}

.qr-box img {
  width: 118px;
  height: 118px;
  padding: 7px;
  border-radius: var(--r-md);
  background: #fff;
}

.interaction-box {
  display: grid;
  gap: 0.95rem;
}

.compact-form {
  gap: 0.8rem;
}

.reservation-row,
.message-row {
  display: grid;
  gap: 0.45rem;
  border-radius: var(--r-md);
  padding: 0.95rem 1.05rem;
}

.reservation-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.reservation-row span,
.message-row span {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.reservation-row strong,
.message-row strong {
  font-weight: 720;
}

.reservation-row p,
.message-row p {
  margin: 0.25rem 0 0;
}

.message-row {
  max-width: 86%;
  border-bottom-left-radius: 5px;
}

.message-row.is-own {
  margin-left: auto;
  background: var(--info-soft);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--glass-border));
  border-bottom-left-radius: var(--r-md);
  border-bottom-right-radius: 5px;
}

.admin-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ------------------------------------------------------------------ Admin */
.admin-list {
  display: grid;
  gap: 0.95rem;
}

.admin-overview {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1.3rem;
}

.admin-section-tabs {
  width: fit-content;
}

.tabs {
  display: inline-flex;
  gap: 0.2rem;
  border-radius: var(--r-pill);
  padding: 0.3rem;
}

.tabs a {
  padding: 0.5rem 1.05rem;
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-weight: 650;
  font-size: 0.92rem;
}

.tabs a:hover {
  color: var(--text);
  text-decoration: none;
}

.tabs a.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  border-radius: var(--r-lg);
  padding: 1.2rem 1.35rem;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.admin-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--glass-border));
}

.admin-row-main {
  display: grid;
  gap: 0.55rem;
}

.admin-row p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.user-row {
  align-items: stretch;
}

.user-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.1rem 0 0;
}

.user-facts div {
  min-width: 0;
}

.user-facts dd {
  font-size: 0.92rem;
}

.admin-user-facts {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ------------------------------------------------- Metrics strip (Moje) */
.toolbar-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.7rem, 1.5vw, 1rem);
  margin: 0 0 1.5rem;
}

.metrics-strip div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-radius: var(--r-lg);
  padding: 1.1rem 1.2rem;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.metrics-strip div:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.metrics-strip span {
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1;
  background: var(--num-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.metrics-strip strong {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 650;
}

/* ------------------------------------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ----------------------------------------------------------- Responsive */
@media (max-width: 980px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bento-hero {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 230px;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters .button {
    grid-column: 1 / -1;
  }

  .account-layout,
  .detail-layout,
  .admin-row,
  .reservation-row,
  .user-facts,
  .admin-user-facts {
    grid-template-columns: 1fr;
  }

  .detail-media {
    position: static;
    min-height: 300px;
  }

  .metrics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topnav-inner {
    grid-template-columns: auto auto;
    row-gap: 0.55rem;
  }

  .nav-links {
    order: 3;
    grid-column: 1 / -1;
    justify-self: stretch;
    overflow-x: auto;
    padding-bottom: 0.1rem;
  }

  .brand-name {
    max-width: 36vw;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15.5px;
  }

  .account-name {
    display: none;
  }

  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar,
  .section-heading,
  .section-title,
  .catalog-head {
    display: grid;
    align-items: start;
  }

  .toolbar-actions,
  .admin-actions,
  .owner-actions,
  .form-actions,
  .hero-cta {
    align-items: stretch;
  }

  .button,
  .toolbar-actions a,
  .hero-cta a,
  .owner-actions a,
  .owner-actions form,
  .owner-actions button,
  .admin-actions form,
  .admin-actions button {
    width: 100%;
  }

  .filters,
  .listing-form fieldset,
  .facts,
  .detail-facts {
    grid-template-columns: 1fr;
  }

  .qr-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .message-row {
    max-width: 100%;
  }
}
