:root {
  --bg: #eef1f8;
  --card: #ffffff;
  --line: #e7ebf3;
  --text: #171b26;
  --muted: #767f95;
  --brand: #4c5fed;
  --brand2: #7b5cf0;
  --brand-ink: #3646c9;
  --red: #ef4457;
  --green: #12b886;
  --ring: rgba(76, 95, 237, 0.35);
  --shadow-sm: 0 1px 2px rgba(23, 30, 55, 0.05);
  --shadow: 0 4px 14px rgba(23, 30, 55, 0.07), 0 1px 3px rgba(23, 30, 55, 0.05);
  --shadow-lg: 0 18px 50px rgba(46, 55, 120, 0.16);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Pretendard', 'Pretendard Variable', -apple-system, BlinkMacSystemFont,
    'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 배경 그라디언트 */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(123, 92, 240, 0.18), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(76, 95, 237, 0.16), transparent 55%),
    linear-gradient(180deg, #f6f8fe 0%, #eef1f8 100%);
}

/* 히어로 */
.hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 56px 20px 24px;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-ink);
  background: rgba(76, 95, 237, 0.1);
  border: 1px solid rgba(76, 95, 237, 0.18);
  margin-bottom: 16px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--brand) 10%, var(--brand2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .sub {
  margin: 14px auto 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 16px;
}

/* 레이아웃 */
main {
  max-width: 780px;
  margin: 0 auto;
  padding: 12px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

/* 스텝 헤더 */
.step { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.step .num {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 4px 12px var(--ring);
}
.step h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-head .step { margin-bottom: 0; }

/* 인식 방식 */
.providers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.providers.two { grid-template-columns: repeat(2, 1fr); }
.prov { position: relative; cursor: pointer; }
.prov input { position: absolute; opacity: 0; pointer-events: none; }
.prov-inner {
  position: relative;
  height: 100%;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fbfcfe;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.18s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.prov:hover .prov-inner { transform: translateY(-2px); box-shadow: var(--shadow); }
.prov input:checked + .prov-inner {
  border-color: var(--brand);
  background: linear-gradient(180deg, #f4f6ff, #ffffff);
  box-shadow: 0 0 0 3px var(--ring);
}
.prov-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.prov-ico { font-size: 22px; }
.prov-inner strong { font-size: 15px; font-weight: 700; }
.prov-desc { font-size: 12.5px; color: var(--muted); }
.prov .check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: none;
  place-items: center;
}
.prov input:checked + .prov-inner .check { display: grid; }
.prov input:checked + .prov-inner .tag { visibility: hidden; }
.prov input:disabled + .prov-inner { opacity: 0.5; }
.prov:has(input:disabled) { cursor: not-allowed; }
.prov:has(input:disabled):hover .prov-inner { transform: none; box-shadow: none; }

.tag { font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.tag.on { background: rgba(18, 184, 134, 0.12); color: var(--green); }
.tag.off { background: rgba(239, 68, 87, 0.1); color: var(--red); }

.hint {
  margin: 16px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  min-height: 18px;
  padding: 10px 14px;
  background: #f6f7fb;
  border-radius: 10px;
}

/* 화자 */
.speaker-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin-bottom: 22px; }
.speaker-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.speaker-btns { display: flex; gap: 8px; }
.spk {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.spk:hover { border-color: var(--brand); }
.spk.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  box-shadow: 0 4px 12px var(--ring);
}
.speaker-row small { flex-basis: 100%; color: var(--muted); font-size: 11.5px; }

/* 녹음 무대 */
.record-stage { display: flex; align-items: center; gap: 22px; }
.record {
  position: relative;
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 10px 28px var(--ring);
  display: grid;
  place-items: center;
  transition: transform 0.15s, box-shadow 0.2s;
}
.record:hover { transform: scale(1.04); }
.record:active { transform: scale(0.97); }
.record .mic { font-size: 32px; filter: grayscale(0.1); }
.record .ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid var(--ring);
  opacity: 0;
}
.record.recording { background: linear-gradient(135deg, #ff5a6a, var(--red)); box-shadow: 0 10px 28px rgba(239, 68, 87, 0.4); }
.record.recording .ring { opacity: 1; animation: pulse 1.4s ease-out infinite; }
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* 파일 업로드 */
.or-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 12.5px; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.upload-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px dashed var(--line);
  background: #fbfcfe;
  color: var(--text);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.upload:hover { border-color: var(--brand); color: var(--brand); background: #f4f6ff; }
.upload-row small { flex-basis: 100%; color: var(--muted); font-size: 11.5px; }

.record-meta { display: flex; flex-direction: column; gap: 2px; }
.record-label { font-size: 17px; font-weight: 700; }
.timer { font-variant-numeric: tabular-nums; font-size: 15px; color: var(--muted); }
.status { font-size: 13px; font-weight: 600; color: var(--brand); min-height: 18px; }
.status.err { color: var(--red); }

/* 원문 */
textarea {
  width: 100%;
  min-height: 210px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  font-size: 15.5px;
  font-family: inherit;
  line-height: 1.75;
  color: var(--text);
  background: #fbfcfe;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--ring); }

.btns { display: flex; gap: 8px; }
button.ghost {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
button.ghost:hover { border-color: var(--brand); color: var(--brand); }
button.ghost.danger:hover { border-color: var(--red); color: var(--red); }

.primary {
  margin-top: 16px;
  width: 100%;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 22px var(--ring);
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}
.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px var(--ring); }
.primary:active { transform: translateY(0); }
.primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.spark { margin-right: 4px; }

/* 정리본 */
.summary-section { box-shadow: var(--shadow-lg); border-color: rgba(76, 95, 237, 0.2); }
.summary { font-size: 15.5px; margin-top: 6px; }
.summary h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 24px 0 10px;
  padding-left: 12px;
  border-left: 4px solid var(--brand);
  letter-spacing: -0.01em;
}
.summary h2:first-child { margin-top: 0; }
.summary h3 { font-size: 15.5px; margin: 16px 0 6px; }
.summary ul { margin: 8px 0; padding-left: 22px; }
.summary li { margin: 4px 0; }
.summary p { margin: 8px 0; }
.summary strong { color: var(--brand-ink); font-weight: 700; }

footer { text-align: center; padding: 8px 20px 40px; color: var(--muted); font-size: 12.5px; }

@media (max-width: 560px) {
  .providers { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .record-stage { gap: 16px; }
  .record { width: 72px; height: 72px; }
  .record .mic { font-size: 28px; }
}
