:root {
  --bg-primary: #070a12;
  --bg-secondary: #0f172a;
  --bg-card: rgba(18, 25, 41, 0.85);
  --bg-card-hover: rgba(28, 38, 60, 0.95);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #10b981;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #10b981;
  --accent-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --accent-glow: rgba(16, 185, 129, 0.25);
  --danger: #ef4444;
  --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --warning: #f59e0b;
  --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-base);
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at 50% 0%, #172554 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.5;
  padding: 16px;
  min-height: 100vh;
}

.container {
  max-width: 580px;
  margin: 0 auto;
  padding-bottom: 50px;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 10px rgba(16, 185, 129, 0.2);
}

.brand-text h1 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.15;
}

.brand-text .tagline {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Cards & Glassmorphism */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}

/* Forms & Modern Inputs */
input[type="text"],
input[type="password"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  background: rgba(11, 17, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(11, 17, 30, 0.95);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Tactile Modern Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s ease;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #042f2e;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
  background: var(--danger-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-small {
  padding: 7px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

/* Modern Segmented Tab Switcher */
.tab-container {
  display: flex;
  background: rgba(11, 17, 30, 0.8);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 18px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 9px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: var(--accent);
  color: #042f2e;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* Question Prompt Sticker (NGL Style) */
.question-prompt-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.prompt-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  background: rgba(16, 185, 129, 0.12);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.prompt-main-text {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
  letter-spacing: -0.2px;
}

/* Modern Voice Recorder UI */
.recorder-box {
  background: rgba(11, 17, 30, 0.85);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 18px;
}

.record-btn-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #042f2e;
  font-size: 1.8rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
  margin: 12px 0;
}

.record-btn-circle:hover {
  transform: scale(1.05);
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.5);
}

.record-btn-circle.recording {
  background: var(--danger-gradient);
  color: #ffffff;
  animation: pulse-ring 1.5s infinite;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
}

@keyframes pulse-ring {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.timer-display {
  font-size: 2.2rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 1px;
}

/* Audio Player */
audio {
  width: 100%;
  height: 40px;
  border-radius: 20px;
  outline: none;
  filter: invert(0.88) hue-rotate(180deg);
}

/* Welcoming Hero & Sections */
.hero-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(14, 165, 233, 0.08) 100%), var(--bg-card);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  margin-bottom: 24px;
  text-align: center;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--accent);
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 8px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.question-list-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.question-list-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.question-text {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 4px;
  word-break: break-word;
}

.question-subtext {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  align-items: center;
}

.featured-card {
  background: var(--bg-card);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  position: relative;
  transition: all 0.2s ease;
}

.featured-card:hover {
  border-color: var(--accent);
}

.featured-question-pill {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 4px 8px;
  display: inline-block;
  margin-bottom: 6px;
}

.featured-question-pill span {
  color: var(--accent);
  font-weight: 700;
}

/* Responses List in Admin */
.response-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.response-content {
  font-size: 1rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

.response-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.alert-warning { background: #451a03; color: #fcd34d; border: 1px solid #78350f; }
.alert-error { background: #450a0a; color: #fca5a5; border: 1px solid #7f1d1d; }
.alert-success { background: #022c22; color: #6ee7b7; border: 1px solid #065f46; }

/* Storage Bar */
.storage-bar-container { margin: 12px 0 8px 0; }
.storage-bar-track {
  width: 100%;
  height: 12px;
  background: rgba(11, 17, 30, 0.9);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.storage-bar-fill { height: 100%; background: var(--accent); width: 0%; }
.storage-bar-fill.warn { background: var(--warning); }
.storage-bar-fill.crit { background: var(--danger); }

/* Discreet Footer */
.site-footer {
  margin-top: 50px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.78rem;
  color: #475569;
  flex-wrap: wrap;
}

.footer-muted-link {
  color: #64748b;
  text-decoration: none;
}

.footer-muted-link:hover { color: var(--text-secondary); }

.footer-admin-link {
  color: #334155;
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.2s ease;
}

.footer-admin-link:hover { color: #94a3b8; }

/* ==========================================================================
   STORY CARD EXPORT STYLING (1080x1920 Instagram Story Resolution)
   ========================================================================== */
#story-card-render {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1080px;
  height: 1920px;
  background: radial-gradient(circle at 50% 18%, #1e293b 0%, #0f172a 45%, #070a12 100%);
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 120px 70px 100px 70px;
  box-sizing: border-box;
  overflow: hidden;
}

.story-brand {
  display: flex;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 940px;
}

.story-logo {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(16, 185, 129, 0.35);
}

.story-brand-info {
  display: flex;
  flex-direction: column;
}

.story-brand-title {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  line-height: 1.1;
}

.story-brand-sub {
  font-size: 32px;
  color: #94a3b8;
  margin-top: 6px;
  font-weight: 500;
}

.story-center-container {
  width: 100%;
  max-width: 940px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  margin: auto 0;
}

/* Question Box (High-Contrast White Sticker) */
.story-question-box {
  width: 100%;
  background: #ffffff;
  color: #0f172a;
  border-radius: 36px;
  padding: 54px 50px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  box-sizing: border-box;
}

.story-box-header {
  margin-bottom: 24px;
}

.story-box-tag {
  display: inline-block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 10px 24px;
  border-radius: 50px;
}

.story-box-tag.question-tag {
  background: #f1f5f9;
  color: #0f172a;
  border: 2px solid #e2e8f0;
}

.story-question-text {
  font-size: 58px;
  font-weight: 800;
  line-height: 1.32;
  color: #0f172a;
  word-break: break-word;
}

/* Connector Arrow */
.story-connector {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: -6px 0;
}

/* Answer Box (Sleek Dark Glass with Emerald Accent) */
.story-answer-box {
  width: 100%;
  background: rgba(30, 41, 59, 0.9);
  border: 3px solid rgba(16, 185, 129, 0.45);
  border-radius: 36px;
  padding: 54px 50px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  box-sizing: border-box;
}

.story-box-tag.answer-tag {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 2px solid rgba(16, 185, 129, 0.35);
}

.story-answer-text {
  font-size: 64px;
  font-weight: 700;
  line-height: 1.35;
  color: #ffffff;
  word-break: break-word;
}

.story-voice-waveform {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 50px;
  color: #38bdf8;
  padding: 10px 0;
}

/* Footer Card */
.story-footer-card {
  width: 100%;
  max-width: 940px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: 30px;
  padding: 36px 24px;
  text-align: center;
}

.story-footer-hint {
  font-size: 34px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 8px;
}

.story-footer-brand {
  font-size: 28px;
  font-weight: 700;
  color: #10b981;
}
