/* Contact self-service portal: phone-first, calm, large touch targets.
   Uses only taki.css tokens for color. */

.portal-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 4px 0 56px;
}

.portal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.portal-greet { font-size: 22px; font-weight: 700; margin: 0 0 2px; }
.portal-org { margin: 0; }

/* ---- save indicator ---------------------------------------- */
.save-status {
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  opacity: 0;
  transition: opacity .18s;
  white-space: nowrap;
  margin-top: 4px;
}
.save-status.show { opacity: 1; }
.save-status.saving { color: var(--text-dim); border-color: var(--border); }
.save-status.saved {
  color: var(--ok);
  border-color: var(--ok);
  background: var(--bg-panel);
}
.save-status.error { color: var(--danger); border-color: var(--danger); }

/* ---- panels ------------------------------------------------- */
.portal-wrap .panel { padding: 18px; }
.panel-title { font-size: 15px; font-weight: 700; margin: 0 0 2px; }
.panel-hint { color: var(--text-dim); font-size: 13px; margin: 0 0 12px; }

/* ---- big calls switch --------------------------------------- */
.portal-hero { transition: border-color .2s; }
.portal-hero.is-on { border-color: color-mix(in srgb, var(--ok) 50%, var(--border)); }
.portal-hero.is-off { border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hero-text h2 { font-size: 16px; font-weight: 700; margin: 0 0 2px; }
.hero-state { color: var(--text-dim); font-size: 13px; margin: 0; }
.portal-hero.is-on .hero-state { color: var(--ok); }
.portal-hero.is-off .hero-state { color: var(--warn); }

/* ---- switch ------------------------------------------------- */
.pswitch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 32px;
  flex-shrink: 0;
  margin: 0;
}
.pswitch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pswitch .knob {
  position: absolute;
  inset: 0;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  pointer-events: none;
  transition: background .15s, border-color .15s;
}
.pswitch .knob::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform .15s, background .15s;
}
.pswitch input:checked + .knob {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.pswitch input:checked + .knob::after {
  transform: translateX(20px);
  background: #fff;
}
.pswitch input:focus-visible + .knob { box-shadow: 0 0 0 3px var(--accent-soft); }

.pswitch-lg { width: 68px; height: 40px; }
.pswitch-lg .knob::after { width: 32px; height: 32px; }
.pswitch-lg input:checked + .knob::after { transform: translateX(28px); }

/* ---- office hours rows -------------------------------------- */
.hours-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  min-height: 50px;
}
.hours-row:last-child { border-bottom: none; }
.hours-day { width: 34px; font-weight: 600; font-size: 13.5px; }
.hours-times { display: flex; align-items: center; gap: 6px; flex: 1; }
/* Wide enough for 12-hour locales ("06:00 PM"); Chrome crops otherwise */
.hours-times input[type="time"] { min-width: 116px; }
.hours-sep { color: var(--text-faint); }
.hours-closed { display: none; color: var(--text-faint); font-size: 13px; flex: 1; }
.hours-row.is-closed .hours-times { display: none; }
.hours-row.is-closed .hours-closed { display: block; }
.hours-row.is-closed .hours-day { color: var(--text-faint); }

/* ---- native pickers, dark ----------------------------------- */
.portal-wrap input[type="time"],
.portal-wrap input[type="datetime-local"] {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--font);
  font-size: 14px;
  min-height: 42px;
  color-scheme: dark;
}
.portal-wrap input[type="time"]:focus,
.portal-wrap input[type="datetime-local"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.portal-wrap input[type="time"] { width: 96px; }

.away-row { display: flex; gap: 10px; align-items: center; }
.away-row input { flex: 1; }

/* multi-org choice buttons */
.org-choices { display: grid; gap: 10px; margin-top: 6px; }

/* blocked-caller rows */
.block-rows { display: grid; gap: 6px; margin-bottom: 12px; }
.block-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg-raised);
  font-family: var(--mono); font-size: 13.5px;
}
.block-row .block-remove { padding: 4px 10px; font-size: 12.5px; }
.block-error:empty { display: none; }

.portal-wrap textarea { resize: vertical; min-height: 44px; }

.portal-signout {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  font-size: 14px;
}

/* ---- login card --------------------------------------------- */
.portal-brand { text-align: center; margin-bottom: 18px; }
.portal-brand .brand-mark {
  width: 40px;
  height: 40px;
  font-size: 20px;
  border-radius: 12px;
}
.portal-card h1 { text-align: center; }
.portal-card .hint { text-align: center; }
.portal-card input[type="tel"] { font-size: 16px; min-height: 46px; }
.portal-btn { min-height: 46px; }
.portal-links { line-height: 2.1; }

.linklike {
  background: none;
  border: none;
  padding: 4px 6px;
  color: var(--accent);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
}
.linklike:hover { text-decoration: underline; }
.linklike:disabled { color: var(--text-faint); cursor: default; text-decoration: none; }

/* ---- code boxes --------------------------------------------- */
.code-boxes {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 18px 0 4px;
}
.code-boxes input {
  width: 46px;
  height: 58px;
  padding: 0;
  text-align: center;
  font-size: 24px;
  font-family: var(--mono);
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  caret-color: var(--accent);
}
.code-boxes input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.code-boxes.shake { animation: portal-shake .35s; }
@keyframes portal-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* ---- small screens ------------------------------------------ */
@media (max-width: 480px) {
  .portal-wrap { padding-bottom: 40px; }
  .portal-wrap .panel { padding: 16px 14px; }
  .code-boxes input { width: 40px; height: 52px; font-size: 21px; }
  .hours-row { flex-wrap: wrap; }
  .hours-times { flex-basis: 100%; padding-left: 46px; }
  .hours-row.is-closed .hours-times { flex-basis: auto; }
}
