/* ============================================================
   The Elemental Horizon — Kiosk UI Styles
   Dark-mode immersive installation aesthetic
   ============================================================ */

/* ---- Element Design Tokens ---- */
:root {
  --fire:   #FF4500;
  --earth:  #C8960C;
  --air:    #7EC8E3;
  --space:  #9B59B6;
  --water:  #1A6B8A;

  --bg-deep:    #070710;
  --bg-card:    #0e0e1c;
  --bg-input:   #12121f;
  --border:     rgba(255,255,255,0.08);
  --text-main:  #e8e8f0;
  --text-muted: #6b6b8a;
  --text-dim:   #3a3a52;

  --font-display: 'Georgia', 'Times New Roman', serif;
  --font-ui:      system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius-card: 20px;
  --radius-btn:  12px;
  --transition:  0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body { width: 100%; height: 100%; }

.eh-body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 16px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* ---- Particle Canvas ---- */
.eh-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* ---- Screen management ---- */
.eh-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px);
  transition: opacity var(--transition), transform var(--transition);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.eh-screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
  z-index: 2;
}

.eh-screen.exit {
  opacity: 0;
  transform: translateY(-24px);
  z-index: 1;
}

/* ---- Centred column layout ---- */
.eh-center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 640px;
  width: 100%;
}

.eh-quiz-col { max-width: 700px; text-align: left; align-items: stretch; }

/* ---- Welcome screen ---- */
.eh-logo-mark {
  width: 100px;
  height: 100px;
  color: var(--air);
  margin-bottom: 28px;
  animation: logoFloat 6s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-10px) rotate(3deg); }
}

.eh-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.eh-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.15;
  background: linear-gradient(135deg, #c8c8e8 0%, var(--air) 50%, var(--space) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.eh-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 480px;
}

/* ---- Step indicator ---- */
.eh-step-indicator {
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.eh-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 400;
  margin-bottom: 10px;
}

.eh-section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ---- Progress bar ---- */
.eh-progress-bar {
  width: 100%;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 32px;
  overflow: hidden;
}

.eh-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--air), var(--space));
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ---- Form elements ---- */
.eh-form-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  text-align: left;
  margin-bottom: 32px;
}

.eh-field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eh-label {
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.eh-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text-main);
  font-size: 1.05rem;
  padding: 14px 18px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font-ui);
  width: 100%;
}

.eh-input:focus {
  border-color: rgba(126, 200, 227, 0.5);
  box-shadow: 0 0 0 3px rgba(126, 200, 227, 0.12);
}

.eh-input::placeholder { color: var(--text-dim); }

.eh-date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}

/* ---- Gender chips ---- */
.eh-chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.eh-chip {
  padding: 10px 20px;
  border-radius: 40px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-ui);
}

.eh-chip:hover   { border-color: rgba(126,200,227,0.4); color: var(--text-main); }
.eh-chip.selected {
  background: rgba(126, 200, 227, 0.15);
  border-color: var(--air);
  color: var(--air);
}

/* ---- Quiz card ---- */
.eh-quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 36px 32px 28px;
}

.eh-question-num {
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.eh-question-text {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 28px;
}

.eh-options-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eh-option-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 14px 18px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
  animation: optionFadeIn 0.3s ease both;
}

.eh-option-btn:nth-child(1) { animation-delay: 0.05s; }
.eh-option-btn:nth-child(2) { animation-delay: 0.12s; }
.eh-option-btn:nth-child(3) { animation-delay: 0.19s; }
.eh-option-btn:nth-child(4) { animation-delay: 0.26s; }

@keyframes optionFadeIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.eh-option-btn:hover   { border-color: rgba(126,200,227,0.4); background: rgba(126,200,227,0.05); }
.eh-option-btn.selected {
  background: rgba(126, 200, 227, 0.12);
  border-color: var(--air);
  color: var(--text-main);
}

/* ---- Processing / orb ---- */
.eh-orb-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1px solid rgba(126,200,227,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: orbPulse 2.5s ease-in-out infinite;
  position: relative;
}

.eh-orb-ring::before {
  content: '';
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  border: 1px solid rgba(155,89,182,0.2);
  animation: orbPulse 2.5s ease-in-out infinite reverse;
}

.eh-orb-inner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(126,200,227,0.5) 0%, rgba(155,89,182,0.3) 60%, transparent 100%);
  animation: orbGlow 2.5s ease-in-out infinite;
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%       { transform: scale(1.08); opacity: 1; }
}

@keyframes orbGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(126,200,227,0.3); }
  50%       { box-shadow: 0 0 50px rgba(126,200,227,0.6), 0 0 80px rgba(155,89,182,0.3); }
}

/* ---- Result layout ---- */
.eh-result-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 1000px;
  width: 100%;
  height: 100%;
  align-items: center;
}

@media (max-width: 768px) {
  #screen-result {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 14px 12px 20px;
  }

  .eh-result-layout {
    grid-template-columns: 1fr;
    gap: 14px;
    overflow: visible;
    height: auto;
    min-height: 0;
    align-items: stretch;
  }

  .eh-result-hero,
  .eh-result-panel {
    height: auto;
    justify-content: flex-start;
    padding: 22px 16px;
  }

  .eh-profile-text {
    max-width: none;
    font-size: 0.9rem;
    line-height: 1.62;
  }
}

.eh-result-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  height: 100%;
  justify-content: center;
}

.eh-element-gif {
  width: 100%;
  max-width: 220px;
  height: 220px;
  object-fit: contain;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 24px rgba(255,255,255,0.15));
}

@media (max-width: 720px) {
  .eh-element-gif {
    max-width: 160px;
    height: 160px;
  }
}

.eh-dominant-label {
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.eh-archetype-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 400;
  margin-bottom: 20px;
}

.eh-profile-text {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 360px;
}

/* ---- Element bars ---- */
.eh-result-panel {
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  height: 100%;
  justify-content: center;
}

.eh-panel-heading {
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.eh-bars-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.eh-bar-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.eh-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.eh-bar-name {
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eh-bar-pct {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.eh-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: hidden;
}

.eh-bar-fill {
  height: 100%;
  border-radius: 6px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- RFID stone prompt ---- */
.eh-stone-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-card);
}

.eh-rfid-ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid rgba(126,200,227,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.eh-rfid-pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(126,200,227,0.3);
  animation: rfidPulse 2s ease-out infinite;
}

.eh-rfid-pulse::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(126,200,227,0.15);
  animation: rfidPulse 2s ease-out infinite 0.5s;
}

@keyframes rfidPulse {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.eh-rfid-icon {
  font-size: 1.8rem;
  color: var(--air);
}

.eh-stone-image {
  width: min(220px, 68vw);
  max-height: 160px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  padding: 6px;
}

.eh-stone-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  max-width: 45ch;
}

.eh-stone-name {
  color: var(--air);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.eh-share-card {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(126,200,227,0.22);
  border-radius: var(--radius-card);
  background: rgba(126,200,227,0.04);
}

.eh-share-title {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.eh-share-qr {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.eh-share-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.45;
}

.eh-auto-reset {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 8px;
}

/* ---- Buttons ---- */
.eh-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(126,200,227,0.15) 0%, rgba(155,89,182,0.15) 100%);
  border: 1px solid rgba(126,200,227,0.4);
  border-radius: var(--radius-btn);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 1rem;
  padding: 14px 36px;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.05em;
}

.eh-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(126,200,227,0.25) 0%, rgba(155,89,182,0.25) 100%);
  border-color: var(--air);
  box-shadow: 0 0 30px rgba(126,200,227,0.2);
  transform: translateY(-1px);
}

.eh-btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.eh-btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  padding: 12px 28px;
  cursor: pointer;
  transition: all var(--transition);
}

.eh-btn-ghost:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--text-main);
}

.eh-btn-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  width: 100%;
  margin-top: 16px;
}

/* ---- Toast ---- */
.eh-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(220, 50, 50, 0.9);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 14px 28px;
  border-radius: 40px;
  font-size: 0.9rem;
  z-index: 999;
  max-width: 400px;
  text-align: center;
  transition: opacity 0.4s ease;
}

.eh-toast.hidden { display: none; }

/* ---- Utility ---- */
.hidden { display: none !important; }
.mt-6  { margin-top: 1.5rem; }
.mt-8  { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }

@media (max-width: 768px) {
  .eh-screen {
    padding: 20px 14px;
  }

  .eh-logo-mark {
    width: 82px;
    height: 82px;
    margin-bottom: 20px;
  }

  .eh-section-subtitle,
  .eh-subtitle {
    line-height: 1.55;
  }

  .eh-quiz-card {
    padding: 24px 18px 20px;
  }

  .eh-question-text {
    line-height: 1.42;
    margin-bottom: 20px;
  }

  .eh-btn-row {
    gap: 10px;
    flex-wrap: wrap;
  }

  .eh-btn-primary,
  .eh-btn-ghost {
    width: 100%;
    min-height: 48px;
  }

  .eh-share-qr {
    width: 136px;
    height: 136px;
  }

  .eh-stone-image {
    width: min(220px, 72vw);
    max-height: 140px;
  }
}
