/* ============ Moon Laundry — дизайн токен ба дундын компонент ============ */
:root {
  /* Өнгө — ус, цэвэр байдал: гүн далайн цэнхэр + аква, дулаан амбер (хаягны самбарын өнгө) */
  --brand-950: #082F49;
  --brand-900: #0C4A6E;
  --brand-700: #0369A1;
  --brand-600: #0284C7;
  --brand-100: #E0F2FE;
  --brand-50: #F0F9FF;
  --aqua-400: #22D3EE;
  --aqua-100: #CFFAFE;
  --amber-500: #F59E0B;
  --amber-100: #FEF3C7;
  --mint-600: #059669;
  --mint-100: #D1FAE5;
  --red-600: #DC2626;
  --red-100: #FEE2E2;

  --ink: #0F172A;
  --ink-2: #46586E;
  --ink-3: #8FA0B3;
  --bg: #F4F7FA;
  --surface: #FFFFFF;
  --border: #E3EAF1;
  --border-2: #CBD8E4;

  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Manrope', 'Inter', system-ui, sans-serif;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(12, 74, 110, 0.06), 0 1px 6px rgba(12, 74, 110, 0.05);
  --shadow-md: 0 4px 16px rgba(12, 74, 110, 0.09), 0 1px 3px rgba(12, 74, 110, 0.06);
  --shadow-lg: 0 16px 44px rgba(8, 47, 73, 0.16);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.18; margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: var(--brand-700); text-decoration: none; }
button { font-family: inherit; }
img, svg { max-width: 100%; }
svg { width: 1.25em; height: 1.25em; flex-shrink: 0; }
:focus-visible { outline: 2.5px solid var(--aqua-400); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--aqua-100); }
.num { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Товч ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-sm); border: 1px solid transparent;
  font: 600 15px/1 var(--font-body); cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s, color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--brand-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover:not(:disabled) { background: var(--brand-600); }
.btn--dark { background: var(--brand-950); color: #fff; }
.btn--dark:hover:not(:disabled) { background: var(--brand-900); }
.btn--ghost { background: var(--surface); color: var(--brand-900); border-color: var(--border-2); }
.btn--ghost:hover:not(:disabled) { border-color: var(--brand-600); color: var(--brand-700); }
.btn--soft { background: var(--brand-50); color: var(--brand-700); }
.btn--soft:hover:not(:disabled) { background: var(--brand-100); }
.btn--danger { background: var(--red-100); color: var(--red-600); }
.btn--danger:hover:not(:disabled) { background: #FECACA; }
.btn--sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn--lg { padding: 14px 26px; font-size: 16px; border-radius: 12px; }
.btn--icon { padding: 8px; border-radius: 8px; }

/* ---------- Карт ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card__pad { padding: 22px; }

/* ---------- Форм ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font: 600 13px/1.3 var(--font-body); color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border-2);
  border-radius: var(--r-sm); font: 500 15px/1.4 var(--font-body); color: var(--ink);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--brand-600); box-shadow: 0 0 0 3.5px rgba(2, 132, 199, .14); }
.input::placeholder { color: var(--ink-3); }
.input--lg { padding: 14px 16px; font-size: 18px; border-radius: var(--r-md); }
.hint { font-size: 12.5px; color: var(--ink-3); }
.error-text { font-size: 13px; color: var(--red-600); font-weight: 500; }

/* ---------- Түвшний тэмдэг ---------- */
.tier {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 99px; font: 700 12px/1.4 var(--font-body);
  letter-spacing: .02em;
}
.tier svg { width: 13px; height: 13px; }
.tier--bronze { background: #FCE8D8; color: #9A5B2D; }
.tier--silver { background: #E8EEF5; color: #5A6B80; }
.tier--gold { background: var(--amber-100); color: #92610A; }
.tier--tier0, .tier--tier1, .tier--tier2, .tier--tier3, .tier--tier4, .tier--tier5 { background: var(--brand-100); color: var(--brand-900); }

/* ---------- Онооны карт — угаалгын машины нүүр ---------- */
.wash-card {
  position: relative;
  background: linear-gradient(155deg, #0E5A80, var(--brand-950) 78%);
  border-radius: var(--r-lg); color: #fff;
  padding-bottom: 16px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .15);
  overflow: hidden;
}
.wash-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 24%, rgba(255, 255, 255, .055) 42%, transparent 58%);
}
.wash-card__screw {
  position: absolute; width: 5px; height: 5px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 35% 30%, rgba(165, 243, 252, .5), rgba(8, 47, 73, .9));
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .55);
}
.wash-card__screw--tl { left: 9px; top: 9px; }
.wash-card__screw--tr { right: 9px; top: 9px; }
.wash-card__screw--bl { left: 9px; bottom: 9px; }
.wash-card__screw--br { right: 9px; bottom: 9px; }

.wash-card__panel {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px;
  background: rgba(4, 29, 47, .5);
  border-bottom: 1px solid rgba(165, 243, 252, .16);
}
.wash-card__knobs { display: flex; gap: 7px; }
.wash-card__knobs i {
  width: 13px; height: 13px; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 35% 30%, #7DD3FC, #0369A1 72%);
  box-shadow: inset 0 -1.5px 2.5px rgba(0, 0, 0, .45), 0 0 0 2px rgba(255, 255, 255, .09);
}
.wash-card__knobs i::after {
  content: ''; position: absolute; left: 50%; top: 1.5px; width: 1.6px; height: 4.5px;
  background: rgba(4, 29, 47, .85); transform: translateX(-50%); border-radius: 2px;
}
.wash-card__knobs i:last-child::after { transform: translateX(-50%) rotate(48deg); transform-origin: bottom; }
.wash-card__brand {
  flex: 1; min-width: 0; font: 700 10.5px/1.4 var(--font-display);
  letter-spacing: .17em; color: #A5F3FC;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wash-card__led {
  font: 800 17px/1 var(--font-display); color: #67E8F9;
  text-shadow: 0 0 9px rgba(34, 211, 238, .8);
  background: #03141F; border-radius: 7px; padding: 6px 10px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .65), 0 0 0 1px rgba(103, 232, 249, .2);
}
.wash-card__led em { font-style: normal; font-size: 11.5px; opacity: .62; }

.wash-card__body {
  display: flex; align-items: center; gap: 20px;
  padding: 20px 20px 2px; position: relative; z-index: 1;
}

/* Иллюминатор — усны түвшин = урамшуулал хүртэлх явц */
.porthole {
  flex-shrink: 0; width: 130px; height: 130px; border-radius: 50%; padding: 9px;
  background: linear-gradient(145deg, #2380AD, #06283F 80%);
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, .22), inset 0 -3px 7px rgba(0, 0, 0, .5),
    0 7px 20px rgba(2, 20, 35, .55);
}
.porthole__glass {
  position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 32% 26%, #0B3A57, #04182A 78%);
  box-shadow: inset 0 0 0 3px rgba(2, 14, 24, .9), inset 0 5px 12px rgba(0, 0, 0, .6);
}
.porthole__drum {
  position: absolute; inset: 8%; border-radius: 50%;
  border: 2px dashed rgba(165, 243, 252, .17);
  animation: drumSpin 16s linear infinite;
}
@keyframes drumSpin { to { transform: rotate(360deg); } }
.porthole__water {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--lvl, 0%);
  background: linear-gradient(180deg, rgba(34, 211, 238, .9), rgba(3, 105, 161, .96));
  transition: height 1.1s cubic-bezier(.22, 1, .36, 1);
}
.porthole__water::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 9px;
  transform: translateY(-95%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='9' viewBox='0 0 90 9'%3E%3Cpath d='M0 9 V5 Q11.25 0 22.5 5 T45 5 T67.5 5 T90 5 V9 Z' fill='%2338CDE8'/%3E%3C/svg%3E") repeat-x bottom / 90px 9px;
  animation: waveMove 3.4s linear infinite;
}
@keyframes waveMove { to { background-position-x: 90px; } }
.porthole__water i {
  position: absolute; bottom: 8%; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .2) 72%);
  animation: bubUp 3.8s ease-in infinite;
}
.porthole__water i:nth-child(1) { left: 20%; width: 7px; height: 7px; animation-delay: .4s; }
.porthole__water i:nth-child(2) { left: 46%; width: 5px; height: 5px; animation-delay: 1.6s; }
.porthole__water i:nth-child(3) { left: 66%; width: 8px; height: 8px; animation-delay: 2.5s; }
.porthole__water i:nth-child(4) { left: 33%; width: 4px; height: 4px; animation-delay: 3.1s; }
@keyframes bubUp {
  0% { transform: translateY(0); opacity: 0; }
  14% { opacity: .95; }
  100% { transform: translateY(-74px); opacity: 0; }
}
.porthole__shine {
  position: absolute; left: 13%; top: 9%; width: 36%; height: 24%; border-radius: 50%;
  background: linear-gradient(160deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 75%);
  transform: rotate(-18deg);
}

/* Хүрдний нүхнүүд = штампууд */
.wash-card__stamps {
  flex: 1; min-width: 0; display: grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 9px;
}
.hole {
  aspect-ratio: 1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 38% 32%, rgba(10, 55, 84, .95), rgba(3, 22, 37, .98));
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .6), inset 0 -1px 1px rgba(255, 255, 255, .08);
  color: rgba(165, 243, 252, .4); font: 600 12px/1 var(--font-body);
}
.hole--on {
  background: linear-gradient(135deg, #7DD3FC, var(--aqua-400) 46%, var(--brand-600));
  box-shadow: 0 0 13px rgba(34, 211, 238, .6), inset 0 1.5px 2.5px rgba(255, 255, 255, .55);
  color: #fff;
  animation: stampPop .45s cubic-bezier(.34, 1.56, .64, 1) backwards;
  animation-delay: var(--d, 0ms);
}
.hole--on svg { width: 44%; height: 44%; fill: #fff; stroke: none; }
@keyframes stampPop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.wash-card__caption {
  padding: 13px 20px 2px; font-size: 12.5px; color: rgba(255, 255, 255, .76);
  position: relative; z-index: 1;
}

/* Жижиг хувилбар (админ) */
.wash-card--compact { border-radius: var(--r-md); padding-bottom: 13px; }
.wash-card--compact .wash-card__panel { padding: 10px 15px; }
.wash-card--compact .wash-card__body { padding: 14px 15px 0; gap: 14px; }
.wash-card--compact .porthole { width: 84px; height: 84px; padding: 6px; }
.wash-card--compact .wash-card__stamps { gap: 6px; }
.wash-card--compact .hole { font-size: 10px; }
.wash-card--compact .wash-card__led { font-size: 14px; padding: 5px 8px; }
.wash-card--compact .wash-card__caption { padding: 10px 15px 0; font-size: 12px; }
.wash-card--compact .wash-card__screw { display: none; }

@media (max-width: 440px) {
  .wash-card__body { flex-direction: column; align-items: center; gap: 16px; }
  .porthole { width: 116px; height: 116px; }
  .wash-card__stamps { align-self: stretch; }
}

/* ---------- Progress bar ---------- */
.progress { height: 9px; border-radius: 99px; background: var(--border); overflow: hidden; }
.progress > i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand-600), var(--aqua-400));
  transition: width .7s cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Toast ---------- */
#toasts { position: fixed; top: 18px; right: 18px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; gap: 10px; align-items: flex-start; max-width: 340px;
  background: var(--brand-950); color: #fff; border-radius: var(--r-md);
  padding: 13px 16px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-8px); transition: all .3s;
}
.toast.show { opacity: 1; transform: none; }
.toast svg { width: 18px; height: 18px; margin-top: 1px; }
.toast--ok svg { color: var(--aqua-400); }
.toast--err { background: #7F1D1D; }
.toast--err svg { color: #FCA5A5; }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(8, 47, 73, .45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 18px;
  animation: fadeIn .18s;
}
.modal {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px; max-height: 92vh; overflow: auto;
  animation: modalUp .25s cubic-bezier(.22, 1, .36, 1);
}
.modal__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px 0;
}
.modal__head h3 { font-size: 18px; }
.modal__body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalUp { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- Купон ---------- */
.coupon {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1.6px dashed var(--border-2); border-radius: var(--r-md); background: var(--brand-50);
}
.coupon__code {
  font: 800 15px/1 var(--font-display); letter-spacing: .06em; color: var(--brand-700);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px;
  padding: 8px 12px; cursor: pointer; display: inline-flex; gap: 7px; align-items: center;
}
.coupon__code:hover { border-color: var(--brand-600); }
.coupon__code svg { width: 14px; height: 14px; color: var(--ink-3); }
.coupon__meta { flex: 1; min-width: 0; }
.coupon__desc { font-weight: 600; font-size: 14px; }
.coupon__till { font-size: 12.5px; color: var(--ink-2); }
.coupon__value { font: 800 17px/1 var(--font-display); color: var(--mint-600); white-space: nowrap; }
