/* style.css - Premium Denim Design System & Animations */

/* Custom Fonts & Variables */
:root {
  --color-bg-deep: #080c16;
  --color-bg-light: #111a2e;
  --color-accent-indigo: #5d5cfc;
  --color-accent-purple: #8b5cf6;
  --color-accent-mint: #10b981;
  --color-accent-orange: #f59e0b;
  --color-accent-rose: #f43f5e;
  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --glass-bg: rgba(15, 23, 42, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-focus: rgba(93, 92, 252, 0.4);
  --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  --font-family-title: 'Outfit', sans-serif;
  --font-family-body: 'Inter', sans-serif;
  --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reset & Global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-bg-deep);
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Glows */
.glow-bg {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.25;
  pointer-events: none;
}

.glow-bg-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--color-accent-indigo) 0%, transparent 80%);
  top: -10%;
  right: -10%;
}

.glow-bg-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--color-accent-purple) 0%, transparent 80%);
  bottom: -10%;
  left: -10%;
}

/* Wrapper Layout */
.app-wrapper {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 16px;
  position: relative;
  z-index: 1;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 24px;
}

.logo {
  font-family: var(--font-family-title);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--color-text-primary);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo-accent {
  background: linear-gradient(135deg, var(--color-accent-indigo), var(--color-accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.main-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: var(--shadow-premium);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
  transform-style: preserve-3d;
  perspective: 1000px;
}

/* Mode Tabs Selector */
.mode-tabs-container {
  display: flex;
  background: rgba(8, 12, 22, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 28px;
  position: relative;
}

.mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-family: var(--font-family-title);
  font-weight: 500;
  font-size: 14px;
  padding: 12px 8px;
  cursor: pointer;
  border-radius: 10px;
  transition: var(--transition-smooth);
  position: relative;
}

.mode-tab.active {
  background: linear-gradient(135deg, rgba(93, 92, 252, 0.15), rgba(139, 92, 246, 0.15));
  color: var(--color-text-primary);
  border: 1px solid rgba(93, 92, 252, 0.25);
  box-shadow: 0 4px 12px rgba(93, 92, 252, 0.1);
}

.tab-icon {
  width: 16px;
  height: 16px;
}

/* Pulse dot on Voice tab */
.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-accent-mint);
  border-radius: 50%;
  position: absolute;
  top: 10px;
  right: 14px;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
  100% { transform: scale(0.9); opacity: 1; }
}

/* Step Panels (Transitions) */
.step-panel {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  flex-grow: 1;
  flex-direction: column;
}

.step-panel.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* Intro Screen */
.intro-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  flex-grow: 1;
}

.fit-badge {
  background: linear-gradient(135deg, rgba(93, 92, 252, 0.2), rgba(139, 92, 246, 0.2));
  color: #a5b4fc;
  border: 1px solid rgba(93, 92, 252, 0.3);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(93, 92, 252, 0.15);
}

.intro-title {
  font-family: var(--font-family-title);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 60%, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-description {
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 90%;
}

.intro-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin-bottom: 24px;
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  border-radius: 14px;
  font-family: var(--font-family-title);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-spring);
  border: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent-indigo), var(--color-accent-purple));
  color: white;
  box-shadow: 0 8px 25px -5px rgba(93, 92, 252, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -5px rgba(93, 92, 252, 0.6);
}

.btn-primary:active {
  transform: translateY(1px);
}

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

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

.btn-voice-start {
  border-color: rgba(93, 92, 252, 0.3);
  box-shadow: inset 0 0 15px rgba(93, 92, 252, 0.05);
}

.btn-voice-start:hover {
  border-color: var(--color-accent-indigo);
  box-shadow: 0 8px 20px -5px rgba(93, 92, 252, 0.2);
}

.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: rotate(45deg);
  transition: all 0.75s ease;
  left: -100%;
}

.btn-glow:hover::after {
  left: 100%;
}

.btn-small {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.voice-mic-icon {
  width: 18px;
  height: 18px;
  color: var(--color-accent-indigo);
  animation: pulse-mic 2s infinite;
}

@keyframes pulse-mic {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); color: var(--color-accent-purple); }
  100% { transform: scale(1); }
}

.intro-footer {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Progress Tracking */
.quiz-progress-wrapper {
  margin-bottom: 24px;
}

.progress-bar-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent-indigo), var(--color-accent-purple));
  border-radius: 10px;
  width: 0;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(93, 92, 252, 0.5);
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-steps-text {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-accent-indigo);
}

.progress-percentage-text {
  font-size: 11px;
  color: var(--color-text-secondary);
}

/* Question Container Layout */
.question-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin-bottom: 24px;
  animation: slide-up 0.35s ease;
}

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

.question-title {
  font-family: var(--font-family-title);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.question-why {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
  border-left: 2px solid var(--color-accent-indigo);
  padding-left: 10px;
}

/* Form Styling (Dropdowns, Cards, Tiles) */

/* Select dropdown */
.select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select {
  width: 100%;
  background: rgba(8, 12, 22, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px 20px;
  font-family: var(--font-family-body);
  font-size: 15px;
  color: var(--color-text-primary);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.custom-select:focus {
  border-color: var(--color-accent-indigo);
  box-shadow: 0 0 0 3px var(--glass-border-focus);
  outline: none;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 6px;
  background-color: var(--color-text-secondary);
  clip-path: polygon(100% 0, 0 0, 50% 100%);
  pointer-events: none;
  transition: var(--transition-smooth);
}

.select-wrapper:focus-within::after {
  background-color: var(--color-accent-indigo);
  transform: translateY(-50%) rotate(180deg);
}

/* Number Entry */
.number-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.custom-number-input {
  width: 100%;
  background: rgba(8, 12, 22, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px 20px;
  font-family: var(--font-family-body);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  color: var(--color-text-primary);
  transition: var(--transition-smooth);
}

.custom-number-input:focus {
  border-color: var(--color-accent-indigo);
  box-shadow: 0 0 0 3px var(--glass-border-focus);
  outline: none;
}

.unit-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  text-align: center;
}

/* Radio Tiles (Options fit, rise, thighs) */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.option-tile {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: var(--transition-spring);
  display: flex;
  align-items: center;
  gap: 14px;
}

.option-tile:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(93, 92, 252, 0.3);
  transform: translateX(4px);
}

.option-tile.selected {
  background: linear-gradient(135deg, rgba(93, 92, 252, 0.08), rgba(139, 92, 246, 0.08));
  border-color: var(--color-accent-indigo);
  box-shadow: 0 4px 15px rgba(93, 92, 252, 0.08);
}

.tile-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.option-tile.selected .tile-indicator {
  border-color: var(--color-accent-indigo);
  background-color: var(--color-accent-indigo);
}

.tile-indicator::after {
  content: '';
  width: 8px;
  height: 8px;
  background-color: white;
  border-radius: 50%;
  transform: scale(0);
  transition: var(--transition-smooth);
}

.option-tile.selected .tile-indicator::after {
  transform: scale(1);
}

.tile-content {
  display: flex;
  flex-direction: column;
}

.tile-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.tile-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* Multi-select Brand Grid */
.brands-grid-container {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
  border: 1px solid var(--glass-border);
  background: rgba(8, 12, 22, 0.2);
  border-radius: 14px;
  padding: 12px;
}

/* Custom Scrollbar */
.brands-grid-container::-webkit-scrollbar {
  width: 6px;
}
.brands-grid-container::-webkit-scrollbar-track {
  background: transparent;
}
.brands-grid-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.brands-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.brand-chip {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.brand-chip.selected {
  background: linear-gradient(135deg, var(--color-accent-indigo), var(--color-accent-purple));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(93, 92, 252, 0.2);
}

/* Conditional Brand Sizing list */
.brand-sizes-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
}

.brand-sizes-list::-webkit-scrollbar {
  width: 6px;
}
.brand-sizes-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.brand-size-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 16px;
}

.brand-size-name {
  font-size: 13px;
  font-weight: 600;
}

.brand-size-input-wrapper {
  width: 80px;
}

.brand-size-input {
  width: 100%;
  background: rgba(8, 12, 22, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px 10px;
  color: white;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.brand-size-input:focus {
  border-color: var(--color-accent-indigo);
  outline: none;
}

/* Frustration Options Grid */
.frustration-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.frustration-tile {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.frustration-tile:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.frustration-tile.selected {
  background: linear-gradient(135deg, rgba(93, 92, 252, 0.1), rgba(139, 92, 246, 0.1));
  border-color: var(--color-accent-indigo);
  color: white;
  box-shadow: 0 4px 12px rgba(93, 92, 252, 0.1);
}

.frustration-icon {
  font-size: 18px;
}

/* Nav Controls */
.quiz-nav-controls {
  display: flex;
  gap: 12px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 20px;
}

.btn-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 12px;
  font-family: var(--font-family-title);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  outline: none;
}

.btn-nav-back {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-secondary);
  border: 1px solid var(--glass-border);
}

.btn-nav-back:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-primary);
}

.btn-nav-back:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-nav-skip {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px dashed rgba(255, 255, 255, 0.15);
}

.btn-nav-skip:hover {
  color: var(--color-text-primary);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-nav-next {
  background: var(--color-accent-indigo);
  color: white;
  box-shadow: 0 4px 15px rgba(93, 92, 252, 0.25);
}

.btn-nav-next:hover {
  background: #4f46e5;
  box-shadow: 0 6px 20px rgba(93, 92, 252, 0.35);
}

/* VOICE PANEL STYLING */
.voice-layout {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  height: 100%;
}

.voice-assistant-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.stylist-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--color-accent-indigo);
  margin-bottom: 12px;
}

.waveform-container {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

/* Voice Orb Waveform effect */
.voice-orb {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-accent-indigo) 0%, var(--color-accent-purple) 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(93, 92, 252, 0.4);
}

.orb-layer {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(93, 92, 252, 0.3);
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  opacity: 0;
  pointer-events: none;
}

/* Stylist voice states */
.voice-orb.idle {
  animation: orb-breathe 4s ease-in-out infinite;
}

.voice-orb.speaking .orb-layer-1 {
  animation: orb-ripple-1 1.5s linear infinite;
}
.voice-orb.speaking .orb-layer-2 {
  animation: orb-ripple-2 1.5s linear infinite 0.5s;
}
.voice-orb.speaking .orb-layer-3 {
  animation: orb-ripple-3 1.5s linear infinite 1s;
}
.voice-orb.speaking {
  animation: orb-pulse-heavy 0.8s ease-in-out infinite alternate;
}

.voice-orb.listening {
  background: radial-gradient(circle, var(--color-accent-mint) 0%, var(--color-accent-indigo) 100%);
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.5);
}

.voice-orb.listening .orb-layer {
  border-color: rgba(16, 185, 129, 0.4);
}
.voice-orb.listening .orb-layer-1 {
  animation: orb-ripple-1 1.2s linear infinite;
}
.voice-orb.listening .orb-layer-2 {
  animation: orb-ripple-2 1.2s linear infinite 0.4s;
}

.voice-orb.processing {
  animation: orb-rotate 1.5s linear infinite;
  background: radial-gradient(circle, var(--color-accent-orange) 0%, var(--color-accent-purple) 100%);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
}

.orb-icon-overlay {
  z-index: 2;
  color: white;
}

.orb-icon-overlay svg {
  width: 28px;
  height: 28px;
  display: none;
}

.orb-icon-overlay svg.active {
  display: block;
}

@keyframes orb-breathe {
  0% { transform: scale(1); box-shadow: 0 0 25px rgba(93, 92, 252, 0.3); }
  50% { transform: scale(1.06); box-shadow: 0 0 35px rgba(93, 92, 252, 0.5); }
  100% { transform: scale(1); box-shadow: 0 0 25px rgba(93, 92, 252, 0.3); }
}

@keyframes orb-pulse-heavy {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

@keyframes orb-rotate {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(360deg) scale(1.04); }
}

@keyframes orb-ripple-1 {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}
@keyframes orb-ripple-2 {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}
@keyframes orb-ripple-3 {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

.voice-status {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-align: center;
}

.voice-status.listening {
  color: var(--color-accent-mint);
  font-weight: 600;
}

.voice-status.processing {
  color: var(--color-accent-orange);
  font-weight: 600;
}

/* Transcript bubble window */
.transcript-box {
  background: rgba(8, 12, 22, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  min-height: 120px;
  justify-content: flex-start;
}

.caption-bubble {
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 90%;
  animation: bubble-fade 0.3s ease;
}

@keyframes bubble-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.caption-bubble.assistant {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-primary);
  border-bottom-left-radius: 2px;
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.caption-bubble.user {
  background: rgba(93, 92, 252, 0.12);
  color: #a5b4fc;
  border-bottom-right-radius: 2px;
  align-self: flex-end;
  border: 1px solid rgba(93, 92, 252, 0.2);
}

.placeholder-text {
  color: var(--color-text-muted);
  font-style: italic;
}

.voice-progress-row {
  margin-bottom: 20px;
}

.voice-progress-details {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

#voice-step-name {
  color: var(--color-accent-indigo);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Fallback/Correction Panel (Overriding values inside Voice mode) */
.voice-correction-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  margin-top: auto;
  margin-bottom: 16px;
}

.correction-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 600;
}

.correction-hint {
  color: var(--color-text-muted);
  font-weight: 400;
}

.correction-input-area {
  margin-bottom: 14px;
}

.correction-input-area .custom-select,
.correction-input-area .custom-number-input {
  padding: 12px 16px;
  font-size: 14px;
}

.correction-input-area .brand-sizes-list {
  max-height: 120px;
}

.correction-actions {
  display: flex;
  gap: 8px;
}

.btn-voice-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-secondary);
  border: 1px solid var(--glass-border);
}

.btn-voice-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.btn-voice-next {
  background: var(--color-accent-indigo);
  color: white;
  border-color: transparent;
  flex: 1.5;
}

.btn-voice-next:hover {
  background: #4f46e5;
}

/* Mic toggles */
.voice-footer-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 14px;
  gap: 12px;
}

.btn-mic-toggle {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #fda4af;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.btn-mic-toggle.active {
  background: rgba(93, 92, 252, 0.1);
  border-color: rgba(93, 92, 252, 0.25);
  color: #c7d2fe;
}

.btn-mic-toggle:hover {
  transform: translateY(-1px);
}

.btn-mic-toggle .mic-off-icon {
  width: 14px;
  height: 14px;
}

.btn-restart-voice {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.btn-restart-voice svg {
  width: 12px;
  height: 12px;
}

.btn-restart-voice:hover {
  color: var(--color-accent-indigo);
}

/* SUCCESS SCREEN */
.success-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex-grow: 1;
}

.success-checkmark-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
}

.success-checkmark-ring {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.15);
  animation: success-ring-pulse 2s infinite;
}

@keyframes success-ring-pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.success-checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: var(--color-accent-mint);
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px var(--color-accent-mint);
  animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s forwards;
}

.checkmark__circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: var(--color-accent-mint);
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% { stroke-dashoffset: 0; }
}
@keyframes fill {
  100% { box-shadow: inset 0px 0px 0px 40px rgba(16, 185, 129, 0.05); }
}

.success-title {
  font-family: var(--font-family-title);
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
}

.success-subtitle {
  color: var(--color-text-secondary);
  font-size: 13px;
  margin-bottom: 24px;
}

.recommendation-preview-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 20px;
  width: 100%;
  margin-bottom: 28px;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
}

.preview-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--color-accent-indigo);
  margin-bottom: 8px;
}

.preview-size-display {
  font-family: var(--font-family-title);
  font-size: 46px;
  font-weight: 800;
  color: white;
  line-height: 1;
  margin-bottom: 16px;
  text-shadow: 0 4px 10px rgba(93, 92, 252, 0.2);
}

.preview-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 14px;
}

.preview-details {
  display: flex;
  justify-content: space-around;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.detail-value {
  font-size: 13px;
  font-weight: 600;
}

.redirect-box {
  width: 100%;
}

.redirect-box p {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.redirect-timer {
  font-weight: 700;
  color: var(--color-accent-indigo);
}

.redirect-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  width: 100%;
  overflow: hidden;
}

.redirect-progress-fill {
  height: 100%;
  background: var(--color-accent-indigo);
  width: 0%;
  border-radius: 4px;
}

/* Footer style */
.app-footer {
  text-align: center;
  margin-top: 20px;
}

.app-footer p {
  font-size: 10px;
  color: var(--color-text-muted);
}

.app-footer a {
  color: var(--color-accent-indigo);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

/* DEVELOPER SANDBOX DEBUG PANEL */
.debug-floating-trigger {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--color-accent-indigo);
  color: #a5b4fc;
  padding: 10px 14px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(93, 92, 252, 0.25);
  backdrop-filter: blur(10px);
}

.debug-floating-trigger:hover {
  transform: translateY(-2px);
  background: var(--color-accent-indigo);
  color: white;
}

.debug-console {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 360px;
  background: rgba(8, 12, 22, 0.95);
  border: 1px solid rgba(93, 92, 252, 0.4);
  border-radius: 16px;
  box-shadow: var(--shadow-premium);
  z-index: 100;
  overflow: hidden;
  backdrop-filter: blur(10px);
  animation: slide-up 0.3s ease;
}

.debug-console.active {
  display: flex;
  flex-direction: column;
}

.debug-header {
  background: rgba(93, 92, 252, 0.15);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(93, 92, 252, 0.25);
  font-family: var(--font-family-title);
  font-size: 12px;
  font-weight: 700;
  color: #c7d2fe;
}

.btn-close-debug {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 14px;
  cursor: pointer;
}

.debug-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.debug-text {
  font-size: 11px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.debug-input-row {
  display: flex;
  gap: 8px;
}

.debug-input-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px 12px;
  color: white;
  font-size: 12px;
}

.debug-input-row input:focus {
  outline: none;
  border-color: var(--color-accent-indigo);
}

.debug-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 110px;
  overflow-y: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}

.suggestion-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10px;
  cursor: pointer;
  color: #a5b4fc;
}

.suggestion-chip:hover {
  background: rgba(93, 92, 252, 0.15);
  border-color: var(--color-accent-indigo);
}

.debug-logs {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  padding: 10px;
  font-family: monospace;
  font-size: 10px;
  color: #38bdf8;
  height: 90px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  line-height: 1.3;
}
.log-entry.speech {
  color: #10b981;
}
.log-entry.error {
  color: #f43f5e;
}
.log-entry.system {
  color: #94a3b8;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  body {
    align-items: flex-start;
  }
  .app-wrapper {
    padding: 12px 8px;
  }
  .main-card {
    padding: 20px 16px;
    border-radius: 20px;
  }
  .intro-title {
    font-size: 26px;
  }
  .debug-console {
    width: calc(100% - 32px);
    left: 16px;
    right: 16px;
  }
}

/* --- 3D INTERFACE ADDITIONS --- */

/* Card Shine glare layer */
.card-shine {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* 3D Orb Canvas Wrapper & Elements */
.voice-orb-3d-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-style: preserve-3d;
  perspective: 600px;
}

#voice-canvas-3d {
  width: 220px;
  height: 220px;
  transform: translateZ(20px);
}

.voice-orb-3d-wrapper .orb-icon-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(40px);
  z-index: 5;
  background: rgba(8, 12, 22, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  padding: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: var(--transition-spring);
}

.voice-orb-3d-wrapper .orb-icon-overlay:hover {
  background: rgba(93, 92, 252, 0.15);
  border-color: var(--color-accent-indigo);
  transform: translate(-50%, -50%) translateZ(50px) scale(1.1);
}

.voice-orb-3d-wrapper .orb-icon-overlay svg {
  width: 24px;
  height: 24px;
  color: white;
}

/* 3D Flip Card Page Transitions */
.page-flip-next-exit {
  animation: flip-out-next 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.page-flip-next-enter {
  animation: flip-in-next 0.45s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.page-flip-prev-exit {
  animation: flip-out-prev 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.page-flip-prev-enter {
  animation: flip-in-prev 0.45s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes flip-out-next {
  0% { opacity: 1; transform: rotateY(0) translateZ(0); }
  100% { opacity: 0; transform: rotateY(-35deg) translateZ(-80px) translateX(-50px); }
}

@keyframes flip-in-next {
  0% { opacity: 0; transform: rotateY(35deg) translateZ(-80px) translateX(50px); }
  100% { opacity: 1; transform: rotateY(0) translateZ(0); }
}

@keyframes flip-out-prev {
  0% { opacity: 1; transform: rotateY(0) translateZ(0); }
  100% { opacity: 0; transform: rotateY(35deg) translateZ(-80px) translateX(50px); }
}

@keyframes flip-in-prev {
  0% { opacity: 0; transform: rotateY(-35deg) translateZ(-80px) translateX(-50px); }
  100% { opacity: 1; transform: rotateY(0) translateZ(0); }
}

/* --- PREMIUM ADDITIONS (LANGS, RESUME, ACCESSIBILITY) --- */

.lang-selector-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 0 4px;
}

.lang-globe-icon {
  width: 14px;
  height: 14px;
  color: var(--color-accent-indigo);
  opacity: 0.8;
}

.lang-select {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family-title);
  outline: none;
  transition: var(--transition-smooth);
}

.lang-select:hover {
  color: var(--color-text-primary);
}

.lang-select option {
  background-color: var(--color-bg-deep);
  color: var(--color-text-primary);
}

/* Glassmorphic Resume Draft modal */
.resume-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 12, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-in 0.3s ease;
}

.resume-modal.active {
  display: flex;
}

.resume-modal-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  width: 100%;
  max-width: 320px;
  box-shadow: var(--shadow-premium);
  transform: scale(0.9);
  animation: scale-up-spring 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.resume-icon-badge {
  font-size: 32px;
  margin-bottom: 12px;
}

.resume-modal-title {
  font-family: var(--font-family-title);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.resume-modal-desc {
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.resume-modal-actions {
  display: flex;
  gap: 10px;
}

.resume-modal-actions .btn {
  flex: 1;
  padding: 10px 14px;
  font-size: 13px;
}

/* Fit Summary Text styling */
.fit-summary-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  text-align: center;
  margin-top: -10px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.01);
}

/* Accessibility screen reader */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Delightful Micro-interactions */
.option-tile:active, .brand-chip:active, .frustration-tile:active {
  transform: scale(0.97);
}

.btn:active {
  transform: scale(0.97) translateY(1px);
}

/* Focus indicator rings */
.custom-select:focus-visible, .custom-number-input:focus-visible, .btn:focus-visible, .mode-tab:focus-visible {
  outline: 2px solid var(--color-accent-indigo);
  outline-offset: 2px;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scale-up-spring {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 3D Intro Weave Canvas Container */
.intro-3d-container {
  width: 240px;
  height: 140px;
  margin: 10px auto 25px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 600px;
  transform-style: preserve-3d;
}

#intro-canvas-3d {
  width: 240px;
  height: 140px;
  filter: drop-shadow(0 0 20px rgba(93, 92, 252, 0.45));
}


