/* Курьер — мобильный рабочий инструмент.
   Тёмная тема, крупные тапы, минимум визуального шума.
   Самодостаточно: НЕ наследует style.css магазина. */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }

:root {
  --cr-bg:        #0f172a;
  --cr-surface:   #1e293b;
  --cr-surface-2: #334155;
  --cr-text:      #f1f5f9;
  --cr-text-dim:  #94a3b8;
  --cr-border:    #334155;
  --cr-primary:   #3b82f6;
  --cr-success:   #22c55e;
  --cr-danger:    #ef4444;
  --cr-warning:   #f59e0b;
  --cr-radius:    14px;
}

html, body {
  background: var(--cr-bg);
  color: var(--cr-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.4;
  min-height: 100vh; min-height: 100dvh;
  overscroll-behavior: none;
}

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input  { font: inherit; color: inherit; outline: none; }
a      { color: inherit; text-decoration: none; }
ul     { list-style: none; }

/* ── Splash ──────────────────────────────────────── */
.splash {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; gap: 12px; color: var(--cr-text-dim);
}
.splash-icon { font-size: 64px; }

/* ── Login ───────────────────────────────────────── */
.cr-login {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding: 80px 24px 24px; gap: 14px;
}
.cr-login-icon { font-size: 80px; line-height: 1; }
.cr-login-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.cr-login-sub   { color: var(--cr-text-dim); text-align: center; }
.cr-login-form  {
  width: 100%; max-width: 320px;
  display: flex; flex-direction: column; gap: 14px;
  margin-top: 24px;
}
.cr-code-input {
  width: 100%;
  font-size: 44px; font-weight: 800;
  letter-spacing: 18px; text-align: center;
  padding: 18px 12px;
  background: var(--cr-surface);
  border: 2px solid var(--cr-border);
  border-radius: 14px;
  color: var(--cr-text);
  font-variant-numeric: tabular-nums;
}
.cr-code-input::placeholder { color: var(--cr-surface-2); letter-spacing: 18px; }
.cr-code-input:focus { border-color: var(--cr-primary); }

/* Поле пароля для регистрации (COURIER_SECRET) */
.cr-secret-input {
  width: 100%;
  font-size: 18px; font-weight: 600;
  text-align: center;
  padding: 18px 16px;
  background: var(--cr-surface);
  border: 2px solid var(--cr-border);
  border-radius: 14px;
  color: var(--cr-text);
}
.cr-secret-input::placeholder { color: var(--cr-surface-2); font-weight: 500; }
.cr-secret-input:focus { border-color: var(--cr-primary); }
.cr-error {
  color: var(--cr-danger); text-align: center;
  background: rgba(239,68,68,.1);
  padding: 10px 14px; border-radius: 10px; font-size: 14px;
}

/* ── Header ──────────────────────────────────────── */
.cr-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px; height: 56px;
  background: var(--cr-bg);
  border-bottom: 1px solid var(--cr-border);
}
.cr-header-title { flex: 1; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.cr-icon-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--cr-text-dim);
  border-radius: 10px;
}
.cr-icon-btn:active { background: var(--cr-surface); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Main + Sections ─────────────────────────────── */
.cr-main { padding: 8px 0 32px; }
.cr-section { padding: 8px 12px; }
.cr-section-title {
  font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--cr-text-dim);
  margin-bottom: 10px; padding: 0 4px;
  display: flex; align-items: center; gap: 8px;
}
.cr-section-count {
  background: var(--cr-surface-2); color: var(--cr-text);
  border-radius: 10px; padding: 2px 8px; font-size: 12px;
}
.cr-section-done .cr-order { opacity: 0.5; }

/* ── Order card ──────────────────────────────────── */
.cr-order {
  background: var(--cr-surface);
  border-radius: var(--cr-radius);
  margin-bottom: 12px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  border-left: 4px solid var(--cr-success);
}
.cr-order-done { border-left-color: var(--cr-text-dim); }

.cr-order-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.cr-order-id {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 700; font-size: 13px; color: var(--cr-text-dim);
  letter-spacing: 0.05em;
}
.cr-order-window { font-size: 17px; font-weight: 700; margin-top: 2px; }
.cr-order-amount { text-align: right; }
.cr-order-amount-value {
  font-size: 24px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cr-order-amount-hint {
  font-size: 11px; color: var(--cr-text-dim);
  text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px;
}

/* ── Контакт: имя + кнопка звонка ──────────────── */
.cr-contact-block {
  display: flex; align-items: center; gap: 12px;
  background: var(--cr-bg);
  padding: 12px 14px; border-radius: 12px;
}
.cr-contact-info { flex: 1; min-width: 0; }
.cr-contact-name {
  font-size: 18px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cr-contact-phone { font-size: 14px; color: var(--cr-text-dim); margin-top: 2px; }
.cr-call-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--cr-success);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  transition: transform .1s;
}
.cr-call-btn:active { transform: scale(0.92); }

/* ── Адрес ───────────────────────────────────────── */
.cr-addr-block {
  display: flex; align-items: center; gap: 10px;
  background: var(--cr-bg);
  padding: 12px 14px; border-radius: 12px;
  font-weight: 600;
}
.cr-addr-block:active { background: var(--cr-surface-2); }
.cr-addr-pin { font-size: 20px; flex-shrink: 0; }
.cr-addr-text { flex: 1; font-size: 15px; line-height: 1.35; }
.cr-addr-arrow { color: var(--cr-primary); font-size: 18px; font-weight: 700; flex-shrink: 0; }

/* ── Заметка ─────────────────────────────────────── */
.cr-notes {
  background: rgba(245,158,11,.12);
  color: #fbbf24;
  padding: 10px 14px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
}

/* ── Состав (раскрыт, не в details) ──────────────── */
.cr-items {
  background: var(--cr-bg);
  border-radius: 10px;
  padding: 12px 14px;
}
.cr-items-title {
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--cr-text-dim);
  margin-bottom: 8px;
}
.cr-items-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--cr-border);
  font-size: 15px;
}
.cr-items-list li:first-child { border-top: none; }
.cr-item-qty {
  color: var(--cr-text-dim);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0; font-weight: 600;
}

/* ── Кнопки ──────────────────────────────────────── */
.cr-btn {
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 800; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .08s, opacity .15s;
  letter-spacing: -0.01em;
}
.cr-btn:active { transform: scale(0.97); }
.cr-btn:disabled { opacity: 0.5; cursor: default; }
.cr-btn-block   { width: 100%; }
.cr-btn-primary { background: var(--cr-primary); color: white; }
.cr-btn-success { background: var(--cr-success); color: white; }
.cr-btn-deliver {
  margin-top: 4px;
  box-shadow: 0 4px 16px rgba(34, 197, 94, .3);
}

.cr-done-stamp {
  text-align: center; padding: 10px;
  color: var(--cr-text-dim); font-weight: 700;
  letter-spacing: 0.03em; font-size: 14px;
}

/* ── Empty ────────────────────────────────────────── */
.cr-empty {
  padding: 100px 24px 40px; text-align: center;
}
.cr-empty-icon { font-size: 64px; opacity: 0.5; }
.cr-empty-text { font-size: 20px; font-weight: 700; margin-top: 16px; }
.cr-empty-sub  { color: var(--cr-text-dim); margin-top: 6px; font-size: 15px; line-height: 1.4; }

/* ── Toast ────────────────────────────────────────── */
.cr-toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%);
  background: var(--cr-text); color: var(--cr-bg);
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 700; font-size: 15px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  animation: cr-toast-in .2s ease-out;
}
@keyframes cr-toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
