/* Birth Scribe Portal — Design System */

:root {
  --bg: #f5f5f9;
  --card: #ffffff;
  --fg: #1a1a2e;
  --muted: #6b6b80;
  --accent: #C33363;
  --accent-hover: #a82955;
  --accent-light: #fdf0f4;
  --accent-soft: linear-gradient(135deg, #fdf0f4 0%, #f0f2fc 100%);
  --success: #2b8a3e;
  --success-light: #edfcf0;
  --warning: #e67700;
  --warning-light: #fff8e6;
  --danger: #c92a2a;
  --danger-light: #fff0f0;
  --border: #e9ecef;
  --radius: 12px;
  --radius-pill: 999px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Menlo', 'Consolas', monospace;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.08);
  --max-w: 1120px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Inter — self-hosted */
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-ExtraBold.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); color: var(--fg); background: var(--bg); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }

/* Layout */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page-body { flex: 1; padding: 48px 0; }

/* Header */
.site-header { background: var(--card); border-bottom: 1px solid var(--border); padding: 16px 0; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.site-header .logo { display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: 18px; color: var(--fg); }
.site-header .logo img { width: 32px; height: auto; }
.site-header nav { display: flex; align-items: center; gap: 24px; }
.site-header nav a { color: var(--muted); font-size: 14px; font-weight: 500; }
.site-header nav a:hover { color: var(--accent); }
.site-header .nav-icon { display: flex; align-items: center; color: var(--muted); }
.site-header .nav-icon:hover { color: var(--accent); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: auto; }
.site-footer .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.site-footer .copyright { color: var(--muted); font-size: 14px; }
.site-footer .links { display: flex; gap: 24px; }
.site-footer .links a { color: var(--muted); font-size: 14px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 28px; border-radius: var(--radius-pill); font-size: 15px; font-weight: 600; font-family: var(--font-body); cursor: pointer; border: 2px solid transparent; transition: all .15s ease; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent-light); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--fg); background: var(--border); }
.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 17px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.card-body { color: var(--muted); font-size: 15px; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--fg); }
.form-input { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 15px; font-family: var(--font-body); background: var(--card); color: var(--fg); transition: border-color .15s; }
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.form-input.error { border-color: var(--danger); }
.form-error { color: var(--danger); font-size: 13px; margin-top: 4px; }

/* Alerts */
.alert { padding: 14px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500; margin-bottom: 20px; }
.alert-success { background: var(--success-light); color: var(--success); }
.alert-warning { background: var(--warning-light); color: var(--warning); }
.alert-danger { background: var(--danger-light); color: var(--danger); }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 32px; }
.tab { padding: 12px 24px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; background: none; border-top: none; border-left: none; border-right: none; font-family: var(--font-body); }
.tab:hover { color: var(--accent); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
td { color: var(--fg); }

/* Badge */
.badge { display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-muted { background: var(--border); color: var(--muted); }

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.flex { display: flex; } .flex-col { flex-direction: column; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.hidden { display: none; }

/* Responsive */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .page-body { padding: 24px 0; }
  .site-header nav { gap: 16px; }
  .btn { padding: 10px 20px; font-size: 14px; }
  h1 { font-size: 26px !important; }
  h2 { font-size: 22px !important; }
}

/* Phone Mockup */
.phone-mockup {
  width: 260px;
  height: 380px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  margin: 0 auto;
}

.phone-mockup .phone-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 2px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  height: 28px;
}

.phone-mockup .phone-topbar svg { width: 14px; height: 14px; }

.phone-mockup .phone-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 8px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .5px;
}

.phone-mockup .phone-divider::before,
.phone-mockup .phone-divider::after {
  content: '';
  flex: 1;
  height: .5px;
  background: var(--border);
}

.phone-mockup .phone-event {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  font-size: 10px;
  align-items: flex-start;
}

.phone-mockup .phone-event:nth-child(odd) { background: var(--bg); }

.phone-mockup .phone-event-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 32px;
}

.phone-mockup .phone-event-icon svg { width: 10px; height: 10px; }

.phone-mockup .phone-event-time {
  font-size: 7px;
  font-family: var(--font-mono);
  color: var(--muted);
}

.phone-mockup .phone-event-text { font-size: 10px; line-height: 1.3; }
.phone-mockup .phone-event-type { font-size: 8px; font-weight: 600; color: var(--accent); }

.phone-mockup .phone-transcript {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--card);
  border-top: 1px solid var(--border);
  font-size: 10px;
}

.phone-mockup .phone-mic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 1.6s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}

.phone-mockup .phone-pause-btn {
  background: var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Onboarding carousel */
.onboarding-carousel { text-align: center; padding: 48px 0; }

.onboarding-steps {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.onboarding-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 280px;
}

.onboarding-step-label {
  font-size: 18px;
  font-weight: 700;
}

.onboarding-step-sub {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}

.onboarding-step-caption {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* Animation keyframes for onboarding */
@keyframes type-word {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slide-in-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slide-in-top {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes swipe-left {
  from { transform: translateX(0); }
  to { transform: translateX(-52px); }
}

.phone-mockup .anim-slide-right {
  animation: slide-in-right .4s ease-out forwards;
}

.phone-mockup .anim-slide-up {
  animation: slide-in-up .4s ease-out forwards;
}

.phone-mockup .anim-slide-top {
  animation: slide-in-top .4s ease-out forwards;
}

/* Birth clock card inside phone */
.birth-clock-card {
  margin: 4px 6px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1.5px solid rgba(201,42,42,.3);
  background: var(--card);
  animation: slide-in-top .4s ease-out forwards;
}

.birth-clock-card .birth-clock-title {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  font-weight: 700;
  color: var(--danger);
}

.birth-clock-card .birth-clock-title svg { width: 8px; height: 8px; }

.birth-clock-card .birth-clock-time {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  margin: 2px 0;
}

.birth-clock-card .birth-clock-reminders {
  font-size: 8px;
  color: var(--muted);
}

/* TTS notification banner */
.tts-banner {
  position: absolute;
  bottom: 38px;
  left: 6px;
  right: 6px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: slide-in-up .3s ease-out forwards;
}

.tts-banner svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Review screen inside phone */
.phone-review-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 12px;
}

.phone-review-nav .cancel { color: #007aff; }
.phone-review-nav .title { font-weight: 600; }
.phone-review-nav .mark-reviewed { color: #2b8a3e; font-weight: 600; }

.confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  margin: 8px 12px;
  background: #fff8e6;
  color: var(--warning);
}

.confidence-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }

.phone-transcription {
  margin: 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  background: var(--card);
}

.phone-audio-player {
  margin: 12px;
  padding: 8px 12px;
  background: var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}

.phone-audio-player svg { width: 14px; height: 14px; color: var(--accent); }

/* PDF mockup */
.phone-pdf-doc {
  margin: 10px 20px;
  padding: 12px;
  background: #f8f8f8;
  border-radius: 3px;
  border: .5px solid rgba(0,0,0,.1);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.phone-pdf-bar {
  height: 5px;
  border-radius: 2px;
  margin-bottom: 4px;
}

.phone-pdf-btns {
  display: flex;
  gap: 8px;
  padding: 8px 20px 12px;
}

.phone-pdf-btn {
  flex: 1;
  text-align: center;
  padding: 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.phone-pdf-btn svg { width: 10px; height: 10px; }

/* Swipe reveal */
.swipe-container { position: relative; overflow: hidden; margin: 0 6px; border-radius: 4px; }

.swipe-reveal-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 52px;
  background: var(--accent);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 8px;
  font-weight: 600;
}

.swipe-reveal-bg svg { width: 10px; height: 10px; }

.swipe-content {
  position: relative;
  background: var(--card);
  transition: transform .5s ease;
}

.swipe-content.swiped { transform: translateX(-52px); }

/* Center logo in empty space */
.phone-center-logo {
  display: flex;
  justify-content: center;
  padding: 16px 0;
  opacity: .4;
}

.phone-center-logo img { width: 32px; height: 32px; }

@media (max-width: 640px) {
  .onboarding-steps { flex-direction: column; align-items: center; gap: 40px; }
  .onboarding-step { max-width: 300px; }
}

/* Policy Content (privacy, terms) */
.policy-content { line-height: 1.75; color: var(--fg); }
.policy-content h1 { font-size: 28px; margin-bottom: 4px; }
.policy-content h2 { font-size: 20px; margin-top: 36px; margin-bottom: 12px; color: var(--fg); }
.policy-content h3 { font-size: 17px; margin-top: 24px; margin-bottom: 8px; }
.policy-content p { margin-bottom: 16px; }
.policy-content ul { margin-bottom: 16px; padding-left: 24px; }
.policy-content li { margin-bottom: 6px; }
.policy-content hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.policy-content .table-wrap { margin-bottom: 20px; }
.policy-content table { margin-bottom: 0; font-size: 14px; }
.policy-content th { font-size: 11px; }
.policy-content a { color: var(--accent); }
.policy-content strong { font-weight: 600; }
.policy-content em { font-style: italic; color: var(--muted); }
@media (max-width: 640px) {
  .policy-content h1 { font-size: 22px; }
  .policy-content h2 { font-size: 17px; margin-top: 28px; }
  .policy-content .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
