:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1d2125;
  --muted: #5f6873;
  --line: #e3e6ea;
  --accent: #1f6feb;
  --accent-dark: #1858c0;
  --error: #c62828;
  --notice-bg: #fff6e0;
  --notice-line: #f0c36d;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[hidden] { display: none !important; }

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

.shop { margin: 4px 2px 12px; }
.shop-name { font-weight: 600; font-size: 17px; }
.shop-phone { color: var(--accent); text-decoration: none; font-size: 15px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.deal { font-size: 20px; margin: 0 0 12px; font-weight: 600; }

.items { list-style: none; margin: 0 0 4px; padding: 0; }
.items li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.items li:last-child { border-bottom: 0; }
.item-calc { color: var(--muted); white-space: normal; }

.link {
  background: none;
  border: 0;
  padding: 6px 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}

.due { font-size: 20px; margin: 16px 0 4px; }
.due strong { white-space: nowrap; }

.muted { color: var(--muted); }

.notice {
  background: var(--notice-bg);
  border: 1px solid var(--notice-line);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0 0;
}

.pay-form { margin-top: 16px; }
.label { display: block; font-weight: 600; margin-bottom: 6px; }

input[type="email"] {
  width: 100%;
  font: inherit;
  font-size: 17px; /* не меньше 16px — иначе iOS увеличивает страницу */
  padding: 12px;
  border: 1px solid #b9c0c8;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
input[type="email"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input.invalid { border-color: var(--error); outline-color: var(--error); }
input[readonly] { background: #f0f2f4; }

.error { color: var(--error); margin: 6px 0 0; font-size: 15px; }
.hint { color: var(--muted); font-size: 14px; margin: 8px 0 16px; }
.hint a { color: var(--accent); }

button.primary, button.secondary {
  display: block;
  width: 100%;
  min-height: 48px;
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button.primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
button.primary:active { background: var(--accent-dark); }
button.secondary { background: #fff; color: var(--text); border: 1px solid #b9c0c8; }
button:disabled { opacity: .7; cursor: default; }
button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.confirm { margin-top: 4px; }
.confirm-text { margin: 0 0 12px; font-size: 17px; }
.email { overflow-wrap: anywhere; word-break: break-word; }
.row { display: grid; grid-template-columns: 1fr; gap: 8px; }

.small { color: var(--muted); font-size: 13px; margin: 16px 0 0; }
#valid-until { margin-top: 6px; }

.msg { margin: 0; font-size: 17px; }
.msg-phone { margin: 12px 0 0; }
.msg-phone a { color: var(--accent); font-size: 17px; text-decoration: none; }

@media (min-width: 420px) {
  .row { grid-template-columns: 1fr 1fr; }
}
