/* Vizanam, the operator's page for a phone. Same paper, jade and lantern gold as the customer's page. */

@font-face {
  font-family: 'Secular One';
  src: url('/fonts/secular-one-hebrew.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

@font-face {
  font-family: 'Secular One';
  src: url('/fonts/secular-one-latin.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

@font-face {
  font-family: 'Assistant';
  src: url('/fonts/assistant-hebrew.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

@font-face {
  font-family: 'Assistant';
  src: url('/fonts/assistant-latin.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

:root {
  --page: #faf4e8;
  --surface: #fffdf8;
  --sunken: #f5eddd;
  --text: #1c2a2d;
  --muted: #5d6968;
  --line: #e2d8c4;
  --accent: #0f7b6c;
  --accent-strong: #0a5c51;
  --accent-text: #ffffff;
  --accent-soft: #dcf0e9;
  --lantern: #f2a93b;
  --lantern-soft: #fdeecf;
  --lantern-text: #7a4a00;
  --info: #1f5a99;
  --info-soft: #e5effa;
  --ok: #1b6e3c;
  --ok-soft: #e0f3e6;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --shadow: 0 1px 2px #3a2a0a12, 0 10px 28px #3a2a0a14;
  --display: 'Secular One', 'Assistant', 'Segoe UI', Arial, sans-serif;
  --body: 'Assistant', 'Segoe UI', 'Heebo', system-ui, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.3, 1.5, 0.5, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0d181c;
    --surface: #15252a;
    --sunken: #101e22;
    --text: #eef1ea;
    --muted: #9db0ad;
    --line: #2a3d41;
    --accent: #4cc9b0;
    --accent-strong: #7fdcc8;
    --accent-text: #05211b;
    --accent-soft: #123a35;
    --lantern: #f6b955;
    --lantern-soft: #3a2c10;
    --lantern-text: #f6c877;
    --info: #8fc0f5;
    --info-soft: #152b42;
    --ok: #7fd6a0;
    --ok-soft: #14321f;
    --danger: #ff8a80;
    --danger-soft: #3b1c1a;
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page);
  color: var(--text);
  font: 500 17px/1.5 var(--body);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

h2,
p {
  margin: 0;
}

.muted {
  color: var(--muted);
  font-weight: 500;
}

.small {
  font-size: 0.875rem;
}

/* --- top bar: dusk over the bay, in a strip --- */

.bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  color: #fff6e2;
  background: linear-gradient(100deg, #0d2a36, #1c5560 62%, #b9763f 130%);
  box-shadow: 0 6px 20px #0d2a3633;
}

.mark {
  width: 34px;
  height: 34px;
  flex: none;
  filter: drop-shadow(0 3px 8px #0006);
  animation: mark-in 0.7s var(--spring) both;
}

.wordmark {
  font: 1.45rem/1 var(--display);
}

.wordmark b {
  font-weight: inherit;
  color: #ffc45e;
}

.tag {
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 999px;
  background: #fff6e222;
  border: 1px solid #fff6e233;
}

.round {
  width: 40px;
  height: 40px;
  margin-inline-start: auto;
  padding: 0;
  font: 1.35rem/1 var(--body);
  color: inherit;
  background: #fff6e21f;
  border: 1px solid #fff6e233;
  border-radius: 50%;
}

.round.spinning {
  animation: spin 0.9s linear infinite;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 14px calc(110px + env(safe-area-inset-bottom));
}

/* --- cards --- */

.card {
  padding: 26px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  animation: rise 0.5s var(--ease) both;
}

.center {
  margin-top: 18px;
  text-align: center;
}

.card h2,
.sheet h2 {
  font: 1.45rem/1.2 var(--display);
  text-wrap: balance;
}

.card h2 + p {
  margin-top: 6px;
}

.card .primary {
  margin-top: 18px;
}

.steps {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  text-align: start;
}

.steps li {
  position: relative;
  padding: 10px 44px 10px 0;
  counter-increment: step;
  animation: rise 0.5s var(--ease) both;
}

.steps li:nth-child(2) {
  animation-delay: 80ms;
}

.steps li:nth-child(3) {
  animation-delay: 160ms;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font: 1rem var(--display);
  color: var(--lantern-text);
  background: var(--lantern-soft);
  border-radius: 50%;
}

/* --- stats --- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stat {
  padding: 10px 6px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  animation: rise 0.45s var(--ease) both;
}

.stat:nth-child(2) {
  animation-delay: 50ms;
}

.stat:nth-child(3) {
  animation-delay: 100ms;
}

.stat:nth-child(4) {
  animation-delay: 150ms;
}

.stat strong {
  display: block;
  font: 1.6rem/1.1 var(--display);
}

.stat span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--muted);
}

.notice {
  margin-top: 12px;
  padding: 12px 14px;
  font-weight: 600;
  color: var(--lantern-text);
  background: var(--lantern-soft);
  border-radius: 14px;
}

/* --- the list --- */

.search {
  margin-top: 12px;
}

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

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  border: 1.5px dashed var(--line);
  border-radius: 20px;
}

.customer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.2s;
}

.customer.open {
  border-color: var(--accent);
}

/* Only the first time the list appears: later refreshes must not make it jump. */
.fresh .customer {
  animation: rise 0.45s var(--ease) both;
}

.fresh .customer:nth-child(2) {
  animation-delay: 50ms;
}

.fresh .customer:nth-child(3) {
  animation-delay: 100ms;
}

.fresh .customer:nth-child(4) {
  animation-delay: 150ms;
}

.fresh .customer:nth-child(n + 5) {
  animation-delay: 200ms;
}

.summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  width: 100%;
  padding: 14px 16px;
  text-align: start;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 0;
}

.summary:active {
  background: var(--sunken);
}

.name {
  font-weight: 800;
  font-size: 1.08rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.8125rem;
}

.chip {
  align-self: center;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--muted);
}

.chip.wait {
  background: var(--info-soft);
  color: var(--info);
}

.chip.todo,
.chip.warn {
  background: var(--lantern-soft);
  color: var(--lantern-text);
}

.chip.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.chip.bad {
  background: var(--danger-soft);
  color: var(--danger);
}

.details {
  padding: 0 16px 16px;
  animation: unfold 0.35s var(--ease) both;
}

.phone a {
  font-weight: 700;
  color: var(--accent-strong);
}

.people {
  margin: 8px 0 10px;
  padding: 0;
  list-style: none;
  border-top: 1px dashed var(--line);
}

.people li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.9375rem;
}

.people strong {
  font-weight: 700;
  color: var(--muted);
}

.people .received strong,
.people .filled strong {
  color: var(--lantern-text);
}

.people .submitted strong {
  color: var(--info);
}

.people .approved strong {
  color: var(--ok);
}

.people .rejected strong {
  color: var(--danger);
}

.code {
  margin-inline-start: 8px;
  font-weight: 600;
}

.send {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.send .primary {
  flex: 1 1 100%;
}

.send .ghost {
  flex: 1;
}

.tip {
  margin-top: 18px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* --- buttons and inputs --- */

button,
.primary {
  font: inherit;
  cursor: pointer;
  border-radius: 16px;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 12px 20px;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--accent-text);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 86%, #fff), var(--accent) 55%);
  border: 0;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 32%, transparent), inset 0 1px 0 #fff3;
  transition: transform 0.12s var(--ease), filter 0.2s;
}

.primary:active {
  transform: scale(0.98);
}

.primary:disabled {
  filter: saturate(0.5);
  opacity: 0.75;
  cursor: progress;
}

.ghost {
  min-height: 48px;
  padding: 10px 16px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--line);
  transition: transform 0.12s var(--ease);
}

.ghost:active {
  transform: scale(0.97);
}

.link {
  display: block;
  margin: 14px auto 0;
  padding: 4px 8px;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--accent-strong);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link.danger {
  color: var(--danger);
}

.fab {
  position: fixed;
  z-index: 5;
  inset-inline: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: fit-content;
  min-height: 58px;
  margin: 0 auto;
  padding: 12px 28px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent-text);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 86%, #fff), var(--accent) 55%);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 1px 0 #fff3;
  animation: fab-in 0.6s var(--spring) 0.25s both;
  transition: transform 0.12s var(--ease);
}

.fab span {
  font-size: 1.35rem;
  line-height: 1;
  margin-inline-end: 4px;
}

.fab:active {
  transform: scale(0.96);
}

label,
.label {
  display: block;
  margin: 16px 0 6px;
  font-weight: 700;
}

input {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  color: inherit;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.15s, box-shadow 0.2s;
}

input[dir='ltr'] {
  text-align: left;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 24%, transparent);
}

.stepper {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  text-align: center;
  background: var(--sunken);
  border: 1.5px solid var(--line);
  border-radius: 16px;
}

.stepper button {
  height: 52px;
  font: 1.6rem/1 var(--body);
  color: var(--accent-strong);
  background: none;
  border: 0;
}

.stepper button:disabled {
  opacity: 0.3;
}

.stepper output {
  font: 1.6rem var(--display);
}

.error {
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--danger);
}

.error:empty {
  display: none;
}

/* --- sheets: dialogs that rise from the bottom --- */

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 24px 20px calc(22px + env(safe-area-inset-bottom));
  overflow: auto;
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -10px 40px #0005;
}

.sheet[open] {
  animation: sheet-up 0.42s var(--ease) both;
}

.sheet::backdrop {
  background: #0a222c99;
  backdrop-filter: blur(3px);
  animation: fade 0.3s both;
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.sheet-actions .primary {
  flex: 1;
}

.sheet-actions .ghost {
  min-height: 54px;
}

#share-body {
  text-align: center;
}

.link-box {
  margin-top: 14px;
  padding: 12px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  background: var(--sunken);
  border: 1.5px dashed var(--line);
  border-radius: 14px;
}

/* A tick that draws itself when a link is made. */
.tick {
  width: 68px;
  height: 68px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  animation: pop 0.5s var(--spring) 0.15s both;
}

.tick::after {
  content: '';
  position: absolute;
  left: 25px;
  top: 14px;
  width: 16px;
  height: 30px;
  border: solid var(--accent-text);
  border-width: 0 5px 5px 0;
  border-radius: 2px;
  transform: rotate(45deg);
  animation: fade 0.3s 0.45s both;
}

.toast {
  position: fixed;
  z-index: 9;
  inset-inline: 16px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 0 auto;
  padding: 10px 18px;
  font-weight: 700;
  color: #fff6e2;
  background: #10303cf2;
  border-radius: 999px;
  box-shadow: 0 8px 24px #0005;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.3s var(--ease);
}

.toast.shown {
  opacity: 1;
  transform: none;
}

.loader {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 18px 0;
}

.loader i {
  width: 12px;
  height: 15px;
  border-radius: 5px 5px 6px 6px;
  background: var(--lantern);
  box-shadow: 0 0 12px var(--lantern);
  animation: hop 1s ease-in-out infinite;
}

.loader i:nth-child(2) {
  animation-delay: 0.15s;
}

.loader i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes unfold {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes mark-in {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-18deg);
  }
}

@keyframes fab-in {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.8);
  }
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes hop {
  50% {
    transform: translateY(-10px);
    opacity: 0.6;
  }
}

[hidden] {
  display: none !important;
}

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