:root {
  color-scheme: dark;
  --bg: #050506;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(255, 255, 255, 0.085);
  --line: rgba(255, 255, 255, 0.095);
  --line-soft: rgba(255, 255, 255, 0.055);
  --text: rgba(255, 255, 255, 0.96);
  --muted: rgba(255, 255, 255, 0.58);
  --subtle: rgba(255, 255, 255, 0.38);
  --accent: #b8f2c8;
  --accent-strong: #d8ffe3;
  --danger: #ff9b9b;
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 16px;
  --ease: cubic-bezier(.2,.8,.2,1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -15%, rgba(97, 119, 104, 0.12), transparent 38rem),
    linear-gradient(180deg, #080809 0%, #050506 44%, #040405 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; }
button { color: inherit; }

button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(216, 255, 227, 0.7);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ambient {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(20px);
  opacity: .65;
}

.ambient--top {
  width: 23rem;
  height: 23rem;
  top: -11rem;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(125, 176, 145, .13), rgba(40, 65, 49, .02) 66%, transparent 72%);
}

.ambient--bottom {
  width: 20rem;
  height: 20rem;
  right: -10rem;
  bottom: -9rem;
  background: radial-gradient(circle, rgba(85, 105, 128, .08), transparent 68%);
}

.app-shell {
  width: min(100%, 720px);
  min-height: 100svh;
  margin: 0 auto;
  padding:
    max(28px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}

.view {
  width: 100%;
  animation: view-in .55s var(--ease) both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* Onboarding */
.onboarding {
  min-height: calc(100svh - 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7vh 0 4vh;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 34px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 19px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 24px 50px rgba(0,0,0,.28);
}

.brand-mark svg {
  width: 30px;
  fill: none;
  stroke: rgba(255,255,255,.88);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.onboarding-copy { max-width: 560px; }

.onboarding-copy h1 {
  margin: 0;
  max-width: 530px;
  font-size: clamp(42px, 12vw, 70px);
  line-height: .96;
  letter-spacing: -.052em;
  font-weight: 660;
}

.onboarding-copy > p:last-child {
  max-width: 430px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 4.5vw, 19px);
  line-height: 1.55;
  letter-spacing: -.012em;
}

.postcode-form {
  margin-top: 44px;
}

.field-shell {
  position: relative;
  display: flex;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.055);
  box-shadow: inset 0 1px rgba(255,255,255,.05), 0 24px 70px rgba(0,0,0,.24);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}

.field-shell:focus-within {
  border-color: rgba(216,255,227,.25);
  background: rgba(255,255,255,.075);
}

.field-shell input {
  min-width: 0;
  flex: 1;
  height: 57px;
  padding: 0 16px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 22px;
  font-weight: 580;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.field-shell input::placeholder {
  color: rgba(255,255,255,.24);
}

.field-action {
  width: 49px;
  height: 49px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 16px;
  background: var(--text);
  color: #090909;
  cursor: pointer;
  transition: transform .18s var(--ease), opacity .18s var(--ease);
}

.field-action:active { transform: scale(.96); }
.field-action svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.field-hint,
.field-error {
  min-height: 18px;
  margin: 12px 8px 0;
  font-size: 12px;
  line-height: 1.45;
}

.field-hint { color: var(--subtle); }
.field-error { color: var(--danger); }
.field-error:empty { display: none; }

.address-picker {
  margin-top: 26px;
  animation: view-in .4s var(--ease) both;
}

.picker-header,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.picker-header p,
.section-heading h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 620;
}

.text-button,
.clear-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.text-button { font-size: 13px; }

.address-options {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.address-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: rgba(255,255,255,.035);
  text-align: left;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}

.address-option:hover {
  background: rgba(255,255,255,.065);
  border-color: var(--line);
}
.address-option:active { transform: scale(.99); }
.address-option strong { display: block; font-size: 15px; font-weight: 600; }
.address-option span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.address-option svg { width: 18px; flex: 0 0 auto; fill: none; stroke: rgba(255,255,255,.44); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Dashboard */
.dashboard { padding-top: 4px; }

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.address-button {
  max-width: min(70vw, 460px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: -2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.address-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-button svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.freshness-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--subtle);
  background: rgba(255,255,255,.025);
  font-size: 11px;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(184,242,200,.07), 0 0 14px rgba(184,242,200,.18);
}

.hero-copy {
  margin-top: clamp(72px, 13vh, 120px);
  text-align: center;
}

.dashboard-status {
  margin-top: clamp(72px, 13vh, 120px);
  text-align: center;
}

.dashboard-status p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 4.5vw, 21px);
  letter-spacing: -.015em;
}

.dashboard-status .text-button {
  margin-top: 18px;
}

.relative-day {
  margin: 0 0 13px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 640;
  letter-spacing: .01em;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(37px, 10vw, 62px);
  line-height: .98;
  letter-spacing: -.052em;
  font-weight: 655;
}

.hero-date {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 4.5vw, 21px);
  letter-spacing: -.015em;
}

.next-card {
  position: relative;
  overflow: hidden;
  margin-top: 36px;
  padding: 9px 9px 0;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035)),
    rgba(12,12,13,.82);
  box-shadow:
    inset 0 1px rgba(255,255,255,.065),
    0 34px 90px rgba(0,0,0,.38);
  backdrop-filter: blur(26px) saturate(115%);
  -webkit-backdrop-filter: blur(26px) saturate(115%);
}

.next-card__glow {
  position: absolute;
  width: 18rem;
  height: 18rem;
  top: -10rem;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(184,242,200,.09), rgba(184,242,200,.02) 45%, transparent 70%);
  pointer-events: none;
}

.next-bins {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
}

.next-bins[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.bin-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 22px 12px 25px;
  text-align: center;
}

.next-bins[data-count="2"] .bin-item + .bin-item {
  border-left: 1px solid var(--line-soft);
}

.bin-icon-wrap {
  position: relative;
  width: 100%;
  height: clamp(142px, 39vw, 205px);
  display: grid;
  place-items: end center;
  isolation: isolate;
}

.bin-icon-wrap::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 88%;
  height: 76%;
  left: 50%;
  bottom: 4%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.072), rgba(255,255,255,.022) 48%, transparent 72%);
  filter: blur(1px);
}

.bin-icon-wrap::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 62%;
  height: 12px;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(0,0,0,.42);
  filter: blur(9px);
}

.bin-visual {
  position: relative;
  width: 100%;
  height: 100%;
}

.bin-image {
  position: absolute;
  display: block;
  object-fit: contain;
  object-position: center bottom;
  filter: saturate(.92) contrast(1.01) drop-shadow(0 17px 20px rgba(0,0,0,.28));
  -webkit-user-drag: none;
  user-select: none;
}

.bin-image--wheelie {
  width: 82%;
  height: 96%;
  left: 9%;
  bottom: 0;
}

.bin-image--food {
  width: 91%;
  height: 82%;
  left: 4.5%;
  bottom: 3%;
}

.bin-visual--pair .bin-image--black {
  z-index: 1;
  width: 66%;
  height: 96%;
  left: 3%;
  bottom: 0;
}

.bin-visual--pair .bin-image--paper-box {
  z-index: 2;
  width: 70%;
  height: 62%;
  right: -2%;
  bottom: 2%;
  object-position: right bottom;
  filter: saturate(.92) contrast(1.01) drop-shadow(0 14px 16px rgba(0,0,0,.33));
}

.bin-copy { margin-top: 16px; }
.bin-name { margin: 0; font-size: clamp(17px, 4.7vw, 21px); line-height: 1.08; letter-spacing: -.025em; font-weight: 625; }
.bin-detail { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }

.next-card__footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--subtle);
  font-size: 11px;
}

.separator {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
}

.upcoming-section { margin-top: 38px; }
.section-heading h2 { font-size: 16px; letter-spacing: -.01em; }
.section-heading span { color: var(--subtle); font-size: 12px; }

.upcoming-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.upcoming-card {
  display: grid;
  grid-template-columns: 57px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 88px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.028);
}

.upcoming-date {
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line-soft);
}

.upcoming-day {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.upcoming-day-number {
  margin-top: 2px;
  font-size: 25px;
  line-height: 1;
  letter-spacing: -.035em;
  font-weight: 620;
}

.upcoming-content { min-width: 0; }
.upcoming-label { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.upcoming-bins { display: flex; flex-wrap: wrap; gap: 7px; }

.upcoming-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 8px 6px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.78);
  font-size: 11px;
}

.upcoming-pill img {
  width: 23px;
  height: 23px;
  object-fit: contain;
  border-radius: 7px;
}

.dashboard-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 42px 0 12px;
  text-align: center;
}

.dashboard-footer p {
  margin: 0;
  color: rgba(255,255,255,.27);
  font-size: 10px;
}

.clear-button {
  padding: 8px 10px;
  color: rgba(255,255,255,.39);
  font-size: 11px;
}

@media (max-width: 370px) {
  .app-shell { padding-left: 16px; padding-right: 16px; }
  .freshness-badge span:last-child { display: none; }
  .freshness-badge { padding: 8px; }
  .hero-copy { margin-top: 62px; }
  .bin-item { padding-left: 8px; padding-right: 8px; }
  .bin-name { font-size: 16px; }
}

@media (min-width: 600px) {
  .app-shell { padding-left: 34px; padding-right: 34px; }
  .onboarding { min-height: calc(100svh - 70px); }
  .postcode-form { max-width: 560px; }
  .address-picker { max-width: 560px; }
  .next-card { margin-top: 44px; padding-left: 12px; padding-right: 12px; }
  .bin-item { padding-top: 30px; padding-bottom: 31px; }
  .upcoming-card { padding-left: 20px; padding-right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Saved address sheet */
.address-dialog {
  width: min(calc(100% - 24px), 520px);
  max-width: none;
  margin: auto auto max(12px, env(safe-area-inset-bottom));
  padding: 12px 18px 18px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 28px;
  background: rgba(24,24,26,.92);
  color: var(--text);
  box-shadow: 0 30px 110px rgba(0,0,0,.7), inset 0 1px rgba(255,255,255,.08);
  backdrop-filter: blur(34px) saturate(130%);
  -webkit-backdrop-filter: blur(34px) saturate(130%);
}

.address-dialog[open] { animation: sheet-in .32s var(--ease) both; }
.address-dialog::backdrop {
  background: rgba(0,0,0,.56);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog-handle {
  width: 34px;
  height: 4px;
  margin: 0 auto 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
}

.address-dialog h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.05;
  letter-spacing: -.035em;
  font-weight: 650;
}

.dialog-address {
  margin: 13px 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.dialog-actions { display: grid; gap: 9px; }
.dialog-button {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255,255,255,.045);
  cursor: pointer;
}

.dialog-button--primary {
  border-color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.94);
  color: #0a0a0a;
  font-weight: 620;
}
