/* The softphone's look: runway-affiliates' Swiss grid, copied by value
   (SPEC-AL-PHONE-002-sign-in-to-the-softphone, "The look"). Phone first. */

:root {
  --bg: #FAFAF8;
  --fg: #111111;
  --muted: #4A4A4A;
  --red: #C8102E;
  --green: #1B7A3A;
  --rule: #D0D0CC;
  --dim: #6F6F6A;
  --font: "Schibsted Grotesk", "Helvetica Neue", Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); }
button { font: inherit; cursor: pointer; border-radius: 0; }
button:disabled { cursor: default; opacity: 0.55; }
a { color: var(--fg); text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
[hidden] { display: none !important; }

.app {
  max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 16px; padding: 20px 0 16px; border-bottom: 4px solid var(--fg);
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.square { display: inline-block; width: 18px; height: 18px; background: var(--red); flex: none; }
.top-right { display: flex; align-items: center; gap: 10px; }
.tag, .admin { height: 22px; padding: 0 8px; font-size: 12px; font-weight: 700; line-height: 22px; }
.tag { color: #FFFFFF; background: var(--muted); }
.tag[data-kind="ok"] { background: var(--green); }
.tag[data-kind="bad"] { background: var(--red); }
.admin { line-height: 18px; background: var(--bg); color: var(--fg); border: 2px solid var(--fg); }
.admin[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.admin:hover { color: var(--red); border-color: var(--red); }

.screen { flex: 1; display: flex; flex-direction: column; padding: 0 16px; }
.screen h2 { margin: 32px 0 12px; font-size: 44px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.lead { margin: 0; font-size: 17px; line-height: 1.5; color: var(--muted); }
.bottom { margin-top: auto; padding: 16px 0 24px; display: flex; flex-direction: column; gap: 12px; }
.fine { align-self: center; font-size: 12px; color: #3A3A3A; }

.primary, .secondary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  width: 100%; text-align: left; font-weight: 700;
}
.primary { min-height: 64px; padding: 0 20px; background: var(--fg); color: var(--bg); border: 0; font-size: 17px; }
.primary:hover:not(:disabled) { background: var(--red); }
.secondary { min-height: 56px; padding: 0 16px; background: var(--bg); color: var(--fg); border: 2px solid var(--fg); font-size: 16px; }
.secondary:hover { color: var(--red); border-color: var(--red); }
.secondary[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

.alert { margin: 24px 0 0; border: 2px solid var(--red); padding: 10px 12px; font-size: 15px; font-weight: 700; color: var(--red); }

.number { padding: 24px 0 24px; display: flex; flex-direction: column; gap: 8px; }
.number label { font-size: 13px; font-weight: 700; }
.field { display: flex; }
.field input {
  flex: 1; min-width: 0; height: 64px; border: 2px solid var(--fg); border-radius: 0;
  background: var(--bg); color: var(--fg); font: inherit; font-size: 32px; font-weight: 800;
  letter-spacing: -0.02em; padding: 0 16px; outline: none; caret-color: var(--red);
}
.erase {
  width: 64px; height: 64px; border: 2px solid var(--fg); border-left: none;
  background: var(--bg); color: var(--fg); display: flex; align-items: center; justify-content: center;
}
.erase:hover { color: var(--red); }
.refused .field input, .refused .erase { border-color: var(--red); }
.refusal { margin: 0; font-size: 14px; font-weight: 700; color: var(--red); }

.pad { border-top: 4px solid var(--fg); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pad button {
  height: 76px; border: none; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule);
  background: transparent; color: var(--fg); font-size: 32px; font-weight: 500;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.pad button:nth-child(3n) { border-right: none; }
.pad button:active { background: var(--fg); color: var(--bg); }
.pad.compact button { height: 60px; font-size: 28px; }
.busy .pad, .busy .number, .busy #call { opacity: 0.55; pointer-events: none; }

.call-head { padding-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; font-weight: 700; }
.time { font-variant-numeric: tabular-nums; }
.call-number {
  font-size: 38px; font-weight: 800; letter-spacing: -0.04em; line-height: 1;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 14px 0 24px;
}
.call-number .hidden-digits { color: var(--dim); }
.label, .tones, .ended { border-top: 1px solid var(--fg); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.caption { font-size: 13px; font-weight: 700; }
.label p { margin: 0; font-size: 19px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.tones .row { padding-bottom: 8px; }
.tones-sent { font-size: 22px; font-weight: 800; letter-spacing: 0.08em; min-height: 26px; }
.ended p { margin: 0; font-size: 17px; line-height: 1.5; color: var(--muted); }
.controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Connecting: the keypad dials itself. Twelve squares lit one after the
   other in a dialling order, the fifth in red, the brand's one accent. */
.dialling {
  margin: auto; display: grid; grid-template-columns: repeat(3, 32px); gap: 12px;
}
.dialling span {
  width: 32px; height: 32px; background: var(--fg); opacity: 0.08;
  animation: dial-key 1.8s cubic-bezier(0.2, 0.7, 0.2, 1) infinite;
}
.dialling span:nth-child(5) { background: var(--red); }
.dialling span:nth-child(1) { animation-delay: 0s; }
.dialling span:nth-child(5) { animation-delay: 0.15s; }
.dialling span:nth-child(9) { animation-delay: 0.3s; }
.dialling span:nth-child(6) { animation-delay: 0.45s; }
.dialling span:nth-child(3) { animation-delay: 0.6s; }
.dialling span:nth-child(2) { animation-delay: 0.75s; }
.dialling span:nth-child(4) { animation-delay: 0.9s; }
.dialling span:nth-child(7) { animation-delay: 1.05s; }
.dialling span:nth-child(8) { animation-delay: 1.2s; }
.dialling span:nth-child(11) { animation-delay: 1.35s; }
.dialling span:nth-child(10) { animation-delay: 1.5s; }
.dialling span:nth-child(12) { animation-delay: 1.65s; }
@keyframes dial-key {
  0% { opacity: 0.08; transform: scale(0.86); }
  8% { opacity: 1; transform: scale(1); }
  40% { opacity: 0.08; transform: scale(0.86); }
  100% { opacity: 0.08; transform: scale(0.86); }
}
@media (prefers-reduced-motion: reduce) {
  .dialling span { animation: none; opacity: 0.3; transform: none; }
  .dialling span:nth-child(5) { opacity: 1; }
}

@media (min-width: 640px) {
  .app { padding-top: 24px; }
}
