@import url('https://fonts.googleapis.com/css2?family=Clash+Display:wght@400;500;600;700&family=Satoshi:wght@300;400;500;700&display=swap');

:root {
  --bg: #05080a;
  --s1: #0c1215;
  --s2: #101820;
  --border: #1a2a22;
  --green: #22c55e;
  --green-dim: #16a34a;
  --green-glow: rgba(34,197,94,0.15);
  --green-glow2: rgba(34,197,94,0.07);
  --text: #e2ffe9;
  --muted: #4d7a5c;
  --red: #ff4d4d;
  --orange: #f59e0b;
  --white: #ffffff;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Satoshi', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  /* Prevent double-tap zoom on mobile */
  touch-action: manipulation;
}

/* Ambient bg */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 10% 0%, rgba(34,197,94,0.06) 0%, transparent 55%),
    radial-gradient(ellipse 50% 60% at 90% 100%, rgba(34,197,94,0.04) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* Noise texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 660px;
  margin: 0 auto;
  padding: 40px 20px 100px;
}

/* ─ Header ─ */
.header {
  margin-bottom: 44px;
  animation: slideDown .6s cubic-bezier(.22,1,.36,1) both;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-glow);
  border: 1px solid rgba(34,197,94,.2);
  border-radius: 100px;
  padding: 6px 14px 6px 8px;
  margin-bottom: 22px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease infinite;
}

.badge span {
  font-size: 12px;
  font-weight: 500;
  color: var(--green);
  letter-spacing: .06em;
  text-transform: uppercase;
}

h1 {
  font-family: 'Clash Display', sans-serif;
  font-size: clamp(38px, 8vw, 62px);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -.03em;
  background: linear-gradient(150deg, #e2ffe9 0%, #22c55e 60%, #16a34a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.sub {
  color: var(--muted);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.65;
  max-width: 440px;
}

/* ─ Mobile hint banner ─ */
.mobile-hint {
  display: none;
  background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.2);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--green);
  margin-bottom: 20px;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .mobile-hint { display: block; }
}

/* ─ Steps ─ */
.steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  animation: slideUp .5s cubic-bezier(.22,1,.36,1) both;
}

.step:nth-child(1) { animation-delay: .08s; }
.step:nth-child(2) { animation-delay: .16s; }
.step:nth-child(3) { animation-delay: .24s; }

.step-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  cursor: default;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Clash Display', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
  transition: all .3s;
}

.step.active .step-num,
.step.done .step-num {
  background: var(--green);
  border-color: var(--green);
  color: #000;
}

.step-title {
  font-family: 'Clash Display', sans-serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
}

.step-tag {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.step.done .step-tag {
  background: rgba(34,197,94,.1);
  border-color: rgba(34,197,94,.25);
  color: var(--green);
}

.step-body {
  padding: 0 22px 22px;
}

/* ─ Inputs ─ */
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .row2 { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .05em;
  text-transform: uppercase;
}

input, select, textarea {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: 'Satoshi', sans-serif;
  font-size: 16px; /* 16px prevents iOS auto-zoom on focus */
  padding: 12px 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
  -webkit-appearance: none; /* Fix iOS styling */
}

input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34,197,94,.1);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234d7a5c' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

select option { background: #0c1215; }

/* phone row */
.phone-row {
  display: flex;
  gap: 8px;
}

.country-btn {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: 'Satoshi', sans-serif;
  font-size: 14px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .2s;
  flex-shrink: 0;
  min-height: 48px; /* easier to tap on mobile */
  -webkit-appearance: none;
}

.country-btn:hover { border-color: var(--green); }
.country-code { color: var(--green); font-weight: 500; font-size: 13px; }

.add-btn {
  width: 100%;
  margin-top: 14px;
  background: var(--green-glow);
  border: 1px dashed rgba(34,197,94,.3);
  border-radius: 12px;
  color: var(--green);
  font-family: 'Satoshi', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 14px; /* taller for mobile */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .2s;
  -webkit-appearance: none;
  min-height: 48px;
}

.add-btn:hover { background: rgba(34,197,94,.12); border-color: var(--green); }

/* Contacts chips */
.chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideUp .3s ease both;
}

.chip-av {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--green), #16a34a);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Clash Display', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #000;
  flex-shrink: 0;
  text-transform: uppercase;
}

.chip-info { flex: 1; min-width: 0; }
.chip-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-phone { font-size: 12px; color: var(--muted); margin-top: 2px; }

.chip-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: color .2s, background .2s;
  display: flex;
  flex-shrink: 0;
  min-width: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
}

.chip-del:hover { color: var(--red); background: rgba(255,77,77,.1); }

/* ─ Voice Recorder ─ */
.voice-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 10px 0 4px;
}

/* Big mic button */
.mic-ring {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mic-ring-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(34,197,94,.15);
  transition: all .3s;
}

.mic-ring-mid {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(34,197,94,.1);
  transition: all .3s;
}

.mic-btn {
  position: relative;
  z-index: 1;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--s2);
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  /* Larger tap target for mobile */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.mic-btn:hover {
  border-color: var(--green);
  box-shadow: 0 0 24px rgba(34,197,94,.2);
  transform: scale(1.05);
}

.mic-btn svg { width: 28px; height: 28px; transition: all .3s; }

/* Recording state */
.mic-btn.recording {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 0 0 rgba(255,77,77,.4);
  animation: ripple-red 1.2s ease infinite;
}

/* Processing state */
.mic-btn.processing {
  background: var(--orange);
  border-color: var(--orange);
  cursor: wait;
}

/* Status label */
.voice-status {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
  min-height: 20px;
  transition: color .3s;
}

.voice-status.listening { color: var(--red); font-weight: 500; }
.voice-status.done { color: var(--green); font-weight: 500; }

/* Waveform bars */
.waveform {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  opacity: 0;
  transition: opacity .3s;
}

.waveform.active { opacity: 1; }

.bar {
  width: 4px;
  background: var(--green);
  border-radius: 4px;
  height: 8px;
  transition: height .1s;
}

.bar:nth-child(1) { animation: wave 1s ease .0s infinite; }
.bar:nth-child(2) { animation: wave 1s ease .1s infinite; }
.bar:nth-child(3) { animation: wave 1s ease .2s infinite; }
.bar:nth-child(4) { animation: wave 1s ease .15s infinite; }
.bar:nth-child(5) { animation: wave 1s ease .05s infinite; }
.bar:nth-child(6) { animation: wave 1s ease .25s infinite; }
.bar:nth-child(7) { animation: wave 1s ease .1s infinite; }

/* Transcript box */
.transcript-box {
  width: 100%;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 72px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  transition: border-color .3s;
  position: relative;
}

.transcript-box.has-text { border-color: rgba(34,197,94,.25); }

.transcript-placeholder {
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

.transcript-edit {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-family: 'Satoshi', sans-serif;
  text-decoration: underline;
  transition: color .2s;
  padding: 4px 8px;
  min-height: 32px;
}

.transcript-edit:hover { color: var(--green); }

.transcript-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Satoshi', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  resize: none;
  min-height: 60px;
  -webkit-appearance: none;
}

/* ─ Send Button ─ */
.send-wrap {
  margin-top: 8px;
  animation: slideUp .5s ease .3s both;
}

.send-btn {
  width: 100%;
  background: var(--green);
  border: none;
  border-radius: 14px;
  color: #000;
  font-family: 'Clash Display', sans-serif;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: .01em;
  padding: 17px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all .2s cubic-bezier(.34,1.3,.64,1);
  position: relative;
  overflow: hidden;
  min-height: 56px; /* easier tap target */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.send-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .2s;
}

.send-btn:hover { box-shadow: 0 10px 32px rgba(34,197,94,.3); transform: translateY(-2px); }
.send-btn:hover::after { opacity: 1; }
.send-btn:active { transform: translateY(0); }
.send-btn:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; box-shadow: none; transform: none; }

.send-btn svg { width: 20px; height: 20px; fill: #000; flex-shrink: 0; }
.send-btn:disabled svg { fill: var(--muted); }

.bulk-note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}

/* ─ Toast ─ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--s1);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Satoshi', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 100px;
  z-index: 200;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 40px);
  white-space: normal;
  text-align: center;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ─ Country modal ─ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

.overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.34,1.2,.64,1);
  overflow: hidden;
}

.overlay.open .modal { transform: translateY(0); }

.modal-hd {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-hd-title {
  font-family: 'Clash Display', sans-serif;
  font-weight: 600;
  font-size: 16px;
}

.modal-x {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 8px;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-x:hover { color: var(--text); }

.modal-search { padding: 12px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-search input { border-radius: 10px; font-size: 16px; }

.c-list { overflow-y: auto; flex: 1; padding: 8px 10px; -webkit-overflow-scrolling: touch; }

.c-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px; /* taller rows for mobile */
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}

.c-item:hover { background: var(--s2); }
.c-flag { font-size: 20px; }
.c-name { flex: 1; font-size: 14px; }
.c-code { font-size: 13px; color: var(--green); font-weight: 500; font-family: monospace; }

/* ─ Animations ─ */
@keyframes slideDown { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp   { from { opacity: 0; transform: translateY(16px); }  to { opacity: 1; transform: translateY(0); } }
@keyframes pulse     { 0%,100% { box-shadow: 0 0 8px var(--green); } 50% { box-shadow: 0 0 16px var(--green), 0 0 28px rgba(34,197,94,.4); } }
@keyframes ripple-red { 0% { box-shadow: 0 0 0 0 rgba(255,77,77,.4); } 70% { box-shadow: 0 0 0 16px rgba(255,77,77,0); } 100% { box-shadow: 0 0 0 0 rgba(255,77,77,0); } }
@keyframes expand1   { 0%,100% { transform: scale(1); opacity: .3; } 50% { transform: scale(1.12); opacity: .15; } }
@keyframes expand2   { 0%,100% { transform: scale(1); opacity: .2; } 50% { transform: scale(1.18); opacity: .08; } }
@keyframes wave      { 0%,100% { height: 8px; } 50% { height: 24px; } }