/* ============================================
   N-Voice Demo Modal — nvoice-demo.css
   ============================================ */
/* IBM Plex Sans is declared once in css/styles.css against a self-hosted woff2,
   which every page loads. This file used to @import it from Google Fonts — the
   worst possible way to fetch a font: an @import cannot be discovered until this
   stylesheet has itself downloaded and parsed, so it added a fourth serialised
   round trip to the critical path and delayed the font to 1,725ms on the
   homepage. Do not reintroduce it; the font is already there. */

/* ── Trigger buttons ── */
[data-nvoice-demo] { cursor: pointer; }

/* ── Overlay ── */
#nvoice-demo-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 10, 22, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#nvoice-demo-overlay.active { display: flex; }

/* ── Modal shell ── */
.ndemo-modal {
  background: #0a1628;
  border: 1px solid rgba(34,211,238,0.18);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  box-shadow:
    0 0 0 1px rgba(34,211,238,0.06),
    0 24px 64px rgba(0,0,0,0.6),
    0 0 80px rgba(34,211,238,0.04) inset;
  overflow: hidden;
  position: relative;
  font-family: 'IBM Plex Sans', sans-serif;
  animation: ndemo-slide-up 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes ndemo-slide-up {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Modal header ── */
.ndemo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 0;
}

.ndemo-header-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.ndemo-header-brand img {
  height: 26px;
  width: auto;
}

.ndemo-header-brand span {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: linear-gradient(90deg, #38bfa1, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: 'IBM Plex Sans', sans-serif;
}

.ndemo-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
  font-family: 'IBM Plex Sans', sans-serif;
}

.ndemo-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ── Step dots ── */
.ndemo-steps {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 16px 22px 0;
}

.ndemo-step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  transition: background 0.3s, width 0.3s;
}

.ndemo-step-dot.active {
  background: #22d3ee;
  width: 22px;
  border-radius: 4px;
}

.ndemo-step-dot.done { background: #38bfa1; }

/* ── Divider under header ── */
.ndemo-header-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34,211,238,0.15), transparent);
  margin: 18px 0 0;
}

/* ── Modal body ── */
.ndemo-body { padding: 24px 22px 28px; }

.ndemo-step { display: none; }

.ndemo-step.active {
  display: block;
  animation: ndemo-fade-in 0.22s ease both;
}

@keyframes ndemo-fade-in {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Typography ── */
.ndemo-title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.ndemo-subtitle {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.45);
  margin: 0 0 22px;
  line-height: 1.55;
}

/* ── Phone fields ── */
.ndemo-phone-fields {
  margin-bottom: 18px;
}

/* Plain text inputs (name, etc.) — same pill style as the phone row */
.ndemo-text-field {
  margin-bottom: 14px;
}

.ndemo-text-input {
  width: 100%;
  background: #111e30;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  font-family: 'IBM Plex Sans', sans-serif;
  padding: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.ndemo-text-input::placeholder { color: rgba(255,255,255,0.2); }

.ndemo-text-input:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34,211,238,0.1);
}

.ndemo-field-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  margin-bottom: 6px;
  display: block;
  font-family: 'IBM Plex Sans', sans-serif;
}

/* Combined phone row — select + input as one pill */
.ndemo-phone-row {
  display: flex;
  align-items: stretch;
  background: #111e30;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ndemo-phone-row:focus-within {
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34,211,238,0.1);
}

/* Fixed AU country label — Australia is the only supported country */
.ndemo-country-label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  font-size: 0.88rem;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 500;
  padding: 14px;
  background: #111e30;
  user-select: none;
}

#ndemo-phone-input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1rem;
  font-family: 'IBM Plex Sans', sans-serif;
  padding: 14px 14px;
  outline: none;
}

#ndemo-phone-input::placeholder { color: rgba(255,255,255,0.2); }

/* ── OTP digits ── */
.ndemo-otp-wrap {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}

.ndemo-otp-digit {
  width: 62px;
  height: 62px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'IBM Plex Sans', sans-serif;
  color: #fff;
  background: #111e30;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  caret-color: #22d3ee;
}

.ndemo-otp-digit:focus {
  border-color: #22d3ee;
  background: #0f1c2e;
}

.ndemo-otp-digit.filled { border-color: #38bfa1; }

/* ── Countdown + resend ── */
.ndemo-otp-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-family: 'IBM Plex Sans', sans-serif;
  color: rgba(255,255,255,0.4);
  margin-bottom: 20px;
}

#ndemo-countdown { color: rgba(255,255,255,0.5); }

#ndemo-resend-btn {
  background: none;
  border: none;
  color: #22d3ee;
  font-size: 0.8rem;
  font-family: 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  display: none;
}

#ndemo-resend-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Channel cards ── */
.ndemo-channel-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.ndemo-channel-card {
  background: #111e30;
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px 14px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.22s, background 0.22s, transform 0.18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Sans', sans-serif;
}

.ndemo-channel-card:hover {
  border-color: #22d3ee;
  background: #0d1e30;
  transform: translateY(-2px);
}

.ndemo-channel-card.loading { opacity: 0.5; pointer-events: none; }
.ndemo-channel-card:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; border-color: rgba(255,255,255,0.06) !important; }
.ndemo-channel-icon { font-size: 1.8rem; line-height: 1; }
.ndemo-channel-label { font-size: 0.9rem; font-weight: 600; color: #fff; }
.ndemo-channel-desc { font-size: 0.74rem; color: rgba(255,255,255,0.4); line-height: 1.4; }

/* ── Active call ── */
.ndemo-call-ui {
  text-align: center;
  font-family: 'IBM Plex Sans', sans-serif;
}

.ndemo-call-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bfa1, #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 1.8rem;
  animation: ndemo-pulse-ring 2s ease-in-out infinite;
}

@keyframes ndemo-pulse-ring {
  0%  { box-shadow: 0 0 0 0 rgba(34,211,238,0.4); }
  70% { box-shadow: 0 0 0 14px rgba(34,211,238,0); }
  100%{ box-shadow: 0 0 0 0 rgba(34,211,238,0); }
}

.ndemo-call-who { font-size: 0.95rem; font-weight: 600; color: #fff; margin-bottom: 4px; }
.ndemo-call-status { font-size: 0.8rem; color: #22d3ee; margin-bottom: 18px; }

.ndemo-call-timer {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 2.2rem;
  font-weight: 300;
  color: #fff;
  letter-spacing: 0.06em;
  margin-bottom: 22px;
}

.ndemo-call-controls { display: flex; gap: 12px; justify-content: center; }

.ndemo-btn-mute {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-family: 'IBM Plex Sans', sans-serif;
}

.ndemo-btn-mute:hover { background: rgba(255,255,255,0.14); }
.ndemo-btn-mute.muted { background: rgba(255,80,80,0.18); border-color: #ff5050; }

.ndemo-btn-end {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 50px;
  background: #c53030;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.ndemo-btn-end:hover { background: #9b2c2c; transform: scale(1.03); }

/* ── Phone callback ── */
.ndemo-phone-waiting {
  text-align: center;
  font-family: 'IBM Plex Sans', sans-serif;
}

.ndemo-phone-waiting .ndemo-call-avatar { background: linear-gradient(135deg, #22c55e, #16a34a); }
.ndemo-late-hint { margin-top: 14px; font-size: 0.78rem; color: rgba(255,255,255,0.3); display: none; }

/* ── Thank you ── */
.ndemo-thankyou {
  text-align: center;
  padding: 6px 0;
  font-family: 'IBM Plex Sans', sans-serif;
}

.ndemo-thankyou-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
  animation: ndemo-pop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes ndemo-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Primary CTA button ── */
.ndemo-btn-primary {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #38bfa1, #22d3ee);
  border: none;
  border-radius: 10px;
  color: #051122;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.01em;
}

.ndemo-btn-primary:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(34,211,238,0.3);
}

.ndemo-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── Spinner ── */
.ndemo-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(5,17,34,0.25);
  border-top-color: #051122;
  border-radius: 50%;
  animation: ndemo-spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ── Error / info ── */
.ndemo-error {
  display: none;
  background: rgba(220,38,38,0.1);
  border: 1px solid rgba(220,38,38,0.25);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 0.82rem;
  font-family: 'IBM Plex Sans', sans-serif;
  color: #fca5a5;
  margin-bottom: 14px;
  line-height: 1.45;
}

.ndemo-error.active { display: block; }

.ndemo-info {
  display: none;
  background: rgba(34,211,238,0.07);
  border: 1px solid rgba(34,211,238,0.18);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 0.82rem;
  font-family: 'IBM Plex Sans', sans-serif;
  color: rgba(255,255,255,0.65);
  margin-bottom: 14px;
  line-height: 1.45;
}

.ndemo-info.active { display: block; }

/* ── Phone display ── */
.ndemo-phone-display {
  font-size: 0.82rem;
  font-family: 'IBM Plex Sans', sans-serif;
  color: rgba(255,255,255,0.4);
  text-align: center;
  margin-bottom: 18px;
}

.ndemo-phone-display strong { color: rgba(255,255,255,0.72); }

/* ── Decorative top bar on modal ── */
.ndemo-modal::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #38bfa1, #22d3ee, #38bfa1);
  background-size: 200% 100%;
  animation: ndemo-shimmer 3s linear infinite;
}

@keyframes ndemo-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .ndemo-modal { border-radius: 16px; max-height: 95vh; overflow-y: auto; }
  .ndemo-body { padding: 18px 16px 24px; }
  .ndemo-otp-digit { width: 54px; height: 54px; font-size: 1.3rem; }
  .ndemo-channel-cards { grid-template-columns: 1fr; }
  .ndemo-title { font-size: 1.25rem; }
  .ndemo-country-select { width: 130px; }
}

/* ── Nexie on the call screens ──
   A compact copy of the homepage hero dial (css/hero-dial.css): the same
   portrait, breathing ring, turning arcs and voice line, so the caller sees
   the same Nexie they clicked on. Self-contained because contact.html doesn't
   load hero-dial.css. During a call the voice line keeps moving, rather than
   the hero's single ripple every few seconds. */
.ndemo-nexie {
  --nx-size: 112px;
  --nx-teal: 56, 191, 161;
  --nx-cyan: 34, 211, 238;
  position: relative;
  width: var(--nx-size);
  height: var(--nx-size);
  margin: calc(var(--nx-size) * 0.16) auto calc(var(--nx-size) * 0.16 + 16px);
}

.ndemo-nexie-wave {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--nx-size) * 2.3);
  height: calc(var(--nx-size) * 0.5);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 0;
  opacity: 0.85;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 28%, #000 72%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 28%, #000 72%, transparent 100%);
}

.ndemo-nexie-wave span {
  flex: 1 1 auto;
  min-width: 2px;
  max-width: 3px;
  height: calc(100% * var(--a, 0.6));
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(var(--nx-cyan), 0.8), rgba(var(--nx-teal), 0.8));
  transform: scaleY(0.2);
  animation: ndemoNexieTalk 1.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.13s);
}

@keyframes ndemoNexieTalk {
  0%, 100% { transform: scaleY(0.2); }
  30%      { transform: scaleY(0.85); }
  55%      { transform: scaleY(0.35); }
  75%      { transform: scaleY(0.65); }
}

.ndemo-nexie-arcs {
  position: absolute;
  inset: -16%;
  width: 132%;
  height: 132%;
  z-index: 1;
  overflow: visible;
  fill: none;
  pointer-events: none;
}

.ndemo-nexie-arcs circle { transform-origin: 50% 50%; }

.ndemo-nexie-arcs .arc-outer {
  stroke: rgba(var(--nx-cyan), 0.6);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-dasharray: 68 52;
  animation: ndemoNexieSpin 18s linear infinite;
}

.ndemo-nexie-arcs .arc-inner {
  stroke: rgba(var(--nx-teal), 0.5);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-dasharray: 26 94;
  animation: ndemoNexieSpin 24s linear infinite reverse;
}

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

.ndemo-nexie-ring {
  position: absolute;
  inset: -8px;
  z-index: 2;
  border-radius: 50%;
  border: 1px solid rgba(var(--nx-teal), 0.75);
  box-shadow: 0 0 0 5px rgba(var(--nx-teal), 0.06), 0 0 26px rgba(var(--nx-teal), 0.28);
  animation: ndemoNexieBreathe 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ndemoNexieBreathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}

.ndemo-nexie-face {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.ndemo-nexie-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ndemo-nexie-face::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 44%, rgba(5, 17, 34, 0) 40%, rgba(5, 17, 34, 0.4) 74%, rgba(5, 17, 34, 0.9) 99%),
    linear-gradient(160deg, rgba(var(--nx-cyan), 0.1), rgba(var(--nx-teal), 0.12));
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .ndemo-nexie-wave span,
  .ndemo-nexie-arcs circle,
  .ndemo-nexie-ring { animation: none; }
}
