:root {
  --bg-top: #000000;
  --bg-bottom: #0b0b0b;
  --card: rgba(20, 20, 20, 0.92);
  --card-border: rgba(255, 255, 255, 0.1);
  --text: #f5f5f5;
  --muted: #b8b8b8;
  --accent: #ffcc00;
  --accent-strong: #d4a700;
  --warm: #7f7f7f;
  --danger: #f87171;
  --info: #a0a0a0;
  --shadow: 0 28px 60px rgba(0, 0, 0, 0.45);
  --radius: 26px;
  --radius-small: 18px;
  color-scheme: dark;
  font-family: "DM Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 204, 0, 0.1), transparent 20%),
    radial-gradient(circle at 85% 18%, rgba(255, 255, 255, 0.06), transparent 24%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom) 72%);
}

body.overlay-open {
  overflow: hidden;
}

button,
input,
pre,
p,
h1,
h2,
li {
  margin: 0;
  font: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(100%, 1140px);
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.hero {
  padding: 12px 4px 28px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: "Montserrat", "DM Sans", sans-serif;
  font-weight: 700;
}

.hero h1 {
  max-width: 15ch;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-family: "Montserrat", "DM Sans", sans-serif;
  font-weight: 800;
}

.lead,
.muted-copy,
.owner-copy,
.confirm-copy,
.confirm-question,
.label,
.meta-line {
  color: var(--muted);
}

.lead {
  margin-top: 18px;
  max-width: 64ch;
  line-height: 1.65;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.auth-layout,
.two-column {
  display: grid;
  gap: 16px;
}

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

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

.auth-card,
.topbar-card,
.home-card,
.result-card,
.admin-card,
.profile-password-card,
.confirm-card,
.scanner-card,
#tab-skis .card,
#tab-my-rentals .card,
#tab-admin .card,
#tab-service .card,
#tab-profile .card {
  padding: 22px;
}

.topbar-card,
.tab-nav,
.tab-panel,
#tab-admin .card,
#tab-profile .card,
#tab-service .card,
#tab-skis .card,
#tab-my-rentals .card {
  margin-top: 16px;
}

.topbar-row,
.section-header,
.toolbar-row,
.confirm-actions,
.inline-form {
  display: flex;
  gap: 12px;
}

.topbar-row,
.section-header,
.toolbar-row,
.confirm-actions {
  align-items: center;
  justify-content: space-between;
}

.stack-form,
.stack-list,
.meta-stack,
.result-grid,
.stats-grid {
  display: grid;
  gap: 12px;
}

.stack-form {
  margin-top: 16px;
}

.result-grid {
  margin-top: 16px;
}

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

.input-group {
  display: grid;
  gap: 8px;
}

.input-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d6d6d6;
}

.text-input {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-small);
  background: rgba(38, 38, 38, 0.92);
  color: var(--text);
}

.text-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.text-input:focus {
  outline: 2px solid rgba(255, 204, 0, 0.45);
  outline-offset: 2px;
}

.compact-input {
  padding: 10px 14px;
  border-radius: 14px;
}

.form-message {
  min-height: 1.4rem;
  color: var(--muted);
}

.form-message.error {
  color: #fecaca;
}

.primary-button,
.ghost-button,
.tab-button {
  border: 0;
  border-radius: 999px;
  font: inherit;
}

.primary-button,
.ghost-button,
.tab-button {
  cursor: pointer;
  transition:
    transform 140ms ease,
    opacity 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.primary-button,
.ghost-button {
  padding: 13px 18px;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #101010;
  font-weight: 700;
}

.ghost-button,
.tab-button {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.primary-button:active,
.ghost-button:active,
.tab-button:active {
  transform: scale(0.98);
}

.primary-button:disabled,
.ghost-button:disabled,
.tab-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.tab-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
}

.tab-button {
  padding: 11px 16px;
}

.tab-button.active {
  background: rgba(255, 204, 0, 0.14);
  border-color: rgba(255, 204, 0, 0.4);
  color: #fff3bf;
}

.home-actions,
.inline-form {
  margin-top: 18px;
}

.group-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.group-filter-button {
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: "Montserrat", "DM Sans", sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.group-filter-button.active {
  background: rgba(255, 204, 0, 0.16);
  border-color: rgba(255, 204, 0, 0.42);
  color: #fff3bf;
}

.group-filter-button:active {
  transform: scale(0.98);
}

.inline-form {
  align-items: flex-end;
  flex-wrap: wrap;
}

.grow {
  flex: 1 1 240px;
}

.align-end {
  align-self: end;
}

.result-item,
.ski-card,
.rental-card,
.meta-card,
.service-highlight {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(30, 30, 30, 0.86);
  padding: 16px;
}

.value {
  margin-top: 6px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
}

.multiline {
  white-space: pre-wrap;
  word-break: break-word;
}

.ski-card.rented-by-me {
  border-color: rgba(255, 204, 0, 0.42);
  background: rgba(255, 204, 0, 0.12);
}

.ski-card {
  padding: 10px 14px;
  border-radius: 16px;
}

.ski-card-header,
.rental-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ski-card-header h3 {
  margin-bottom: 1px;
  font-size: 1.15rem;
}

.ski-title {
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  font-size: 0.97rem;
}

.ski-meta-inline {
  margin-top: 3px;
  font-size: 0.88rem;
}

.ski-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 6px 4px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ski-group-header:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.ski-group-header h3 {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 800;
}

.ski-group-header span {
  color: var(--muted);
  font-family: "Montserrat", "DM Sans", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #e9e9e9;
  font-size: 0.82rem;
}

.pill.success {
  background: rgba(255, 204, 0, 0.16);
  color: #fff3bf;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(30, 30, 30, 0.86);
  padding: 16px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.6rem;
  letter-spacing: -0.04em;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(14px);
}

.overlay-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 640px);
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.reader-frame {
  width: 100%;
  min-height: 320px;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(8, 8, 8, 0.96);
}

.confirm-copy,
.confirm-question {
  margin-top: 12px;
}

.confirm-value {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(30, 30, 30, 0.9);
}

.confirm-symbol {
  margin-top: 14px;
  color: var(--accent);
  font-family: "Montserrat", "DM Sans", sans-serif;
  font-size: clamp(2rem, 7vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.confirm-actions {
  margin-top: 20px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  color: var(--muted);
}

.inline-status {
  min-height: 1.3rem;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.inline-status.ready {
  color: #ffe27a;
}

.inline-status.error {
  color: #fecaca;
}

h2,
h3,
.topbar-row h2,
.section-header h2,
.ski-card h3,
.rental-card h3,
.stat-card strong {
  font-family: "Montserrat", "DM Sans", sans-serif;
}

h2,
.section-header h2,
.overlay-header h2,
.topbar-row h2 {
  font-weight: 700;
}

h3,
.ski-card h3,
.rental-card h3 {
  font-weight: 600;
}

@media (max-width: 860px) {
  .auth-layout,
  .two-column,
  .name-grid {
    grid-template-columns: 1fr;
  }

  .topbar-row,
  .toolbar-row,
  .section-header,
  .confirm-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .tab-nav {
    padding: 12px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 20px 12px 36px;
  }

  .hero h1 {
    max-width: none;
  }

  .auth-card,
  .topbar-card,
  .home-card,
  .result-card,
  .admin-card,
  .profile-password-card,
  .confirm-card,
  .scanner-card,
  #tab-skis .card,
  #tab-my-rentals .card,
  #tab-admin .card,
  #tab-service .card,
  #tab-profile .card {
    padding: 18px;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .align-end {
    align-self: stretch;
  }
}
