/* ============================================================
   Maximus Centro Auditivo — Teste Auditivo Online
   Versão Standalone HTML/CSS/JS Vanilla
   ============================================================ */

:root {
  --maximus-dark: #1a2e26;
  --maximus-green: #2D4A3E;
  --maximus-light: #3a5f4f;
  --maximus-emerald: #27ae60;
  --maximus-emerald-light: #2ecc71;
  --bg-cream: #f5f5f0;
  --bg-light: #f0f2ed;
  --text-dark: #1a2e26;
  --text-muted: #6b7c74;
  --border-color: #e0e5e0;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-cream);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---- UTILITY CLASSES ---- */
.hidden { display: none !important; }
.text-center { text-align: center; }

/* ---- HEADER ---- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
}
.app-header.light { background: #fff; border-bottom: 1px solid var(--border-color); }
.app-header.transparent { background: transparent; }
.app-header.dark { background: var(--maximus-dark); }
.app-header img { height: 40px; }
.app-header .brand-text { display: none; }
@media (min-width: 640px) {
  .app-header .brand-text { display: block; }
}
.app-header .brand-text p:first-child {
  font-size: 14px; font-weight: 700; line-height: 1.2;
}
.app-header .brand-text p:last-child {
  font-size: 10px; letter-spacing: 0.2em; opacity: 0.7;
}
.app-header.transparent .brand-text,
.app-header.dark .brand-text { color: #fff; }
.app-header.transparent img,
.app-header.dark img { filter: brightness(10) contrast(0.8); }

/* ---- SCREEN CONTAINER ---- */
.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.4s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- HERO SECTION ---- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  background-size: cover;
  background-position: center;
  background-image: url('https://d2xsxph8kpxj0f.cloudfront.net/310419663028536145/FdqUefcx9YXFimxQECMzaA/landing-hero-bg-RasMVfkWfk3mZt8DSAka4k.webp');
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(26,46,38,0.8), rgba(26,46,38,0.6), rgba(26,46,38,0.9));
}
.hero-content {
  position: relative; z-index: 10;
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px; text-align: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 9999px;
  background: rgba(255,255,255,0.1); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2); margin-bottom: 24px;
  color: rgba(255,255,255,0.9); font-size: 14px; font-weight: 500;
}
.hero-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2ecc71; animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.5; }
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  color: #fff; margin-bottom: 16px; line-height: 1.1;
}
.hero h1 span { color: #2ecc71; }
.hero .subtitle {
  color: rgba(255,255,255,0.8); font-size: clamp(1rem, 2.5vw, 1.25rem);
  max-width: 560px; line-height: 1.6; margin-bottom: 16px;
}
.hero .disclaimer-small {
  color: rgba(255,255,255,0.5); font-size: 14px; margin-bottom: 32px;
}
.hero .quick-stats {
  display: flex; flex-wrap: wrap; gap: 24px;
  justify-content: center; margin-top: 32px;
  color: rgba(255,255,255,0.7); font-size: 14px;
}
.hero .quick-stats div { display: flex; align-items: center; gap: 8px; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 18px 40px; border-radius: 16px; font-size: 18px; font-weight: 700;
  font-family: var(--font-sans); border: none; cursor: pointer;
  transition: all 0.2s; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: #fff; box-shadow: 0 8px 32px rgba(39,174,96,0.3);
}
.btn-primary:hover { transform: scale(1.05); box-shadow: 0 12px 40px rgba(39,174,96,0.4); }
.btn-outline {
  background: transparent; border: 2px solid var(--border-color);
  color: var(--text-dark);
}
.btn-outline:hover { background: var(--bg-light); }
.btn-whatsapp {
  background: #25D366; color: #fff; width: 100%;
  padding: 16px; border-radius: 12px; font-size: 16px;
}
.btn-whatsapp:hover { transform: scale(1.02); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.btn-sm { padding: 12px 24px; font-size: 14px; border-radius: 12px; }
.btn-full { width: 100%; }
.btn-ghost {
  background: none; border: none; color: var(--text-muted);
  font-size: 14px; cursor: pointer; padding: 8px;
}
.btn-ghost:hover { color: var(--text-dark); }

/* ---- SECTIONS ---- */
.section {
  padding: 64px 24px;
}
.section-white { background: #fff; }
.section-light { background: var(--bg-light); }
.section-dark {
  background: linear-gradient(135deg, #2D4A3E, #1a2e26);
  color: #fff;
}
.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--maximus-dark); margin-bottom: 16px;
}
.section-dark h2 { color: #fff; }
.section .section-desc {
  color: var(--text-muted); max-width: 480px;
  margin: 0 auto 48px; line-height: 1.6;
}
.section-inner { max-width: 960px; margin: 0 auto; }

/* ---- CARDS GRID ---- */
.cards-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.card {
  background: #fff; border-radius: 16px; padding: 24px;
  text-align: center; transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.08); }
.section-light .card { background: #fff; }
.card-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; font-size: 24px;
}
.card-icon.green {
  background: linear-gradient(135deg, #27ae60, #2ecc71); color: #fff;
}
.card-icon.teal {
  background: rgba(45,74,62,0.1); color: var(--maximus-green);
}
.card h3 {
  font-family: var(--font-sans); font-size: 16px; font-weight: 700;
  color: var(--maximus-dark); margin-bottom: 8px;
}
.card p { font-size: 14px; color: var(--text-muted); line-height: 1.5; }

/* ---- OMS REFERENCE ---- */
.oms-ref {
  display: flex; flex-direction: column; align-items: center; gap: 32px;
}
@media (min-width: 768px) {
  .oms-ref { flex-direction: row; align-items: flex-start; }
}
.oms-ref img { width: 128px; height: 128px; flex-shrink: 0; }
@media (min-width: 768px) {
  .oms-ref img { width: 160px; height: 160px; }
}
.oms-ref h2 { margin-bottom: 16px; }
.oms-ref p { color: var(--text-muted); line-height: 1.7; margin-bottom: 16px; }
.oms-checks {
  display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: #1a8a4a;
}
.oms-checks div { display: flex; align-items: center; gap: 6px; }
.oms-source { font-size: 12px; color: var(--text-muted); margin-top: 16px; }

/* ---- STATS BAR ---- */
.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
  text-align: center;
}
@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.stats-grid .stat-value {
  font-family: var(--font-mono); font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700; color: #fff;
}
.stats-grid .stat-label {
  font-size: 14px; color: rgba(255,255,255,0.6); margin-top: 4px;
}

/* ---- FOOTER ---- */
.footer {
  background: var(--maximus-dark); padding: 40px 24px;
}
.footer-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 24px;
}
@media (min-width: 768px) {
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: flex-start; }
}
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.footer-brand img { height: 32px; filter: brightness(10) contrast(0.8); }
.footer-brand .brand-name { color: #fff; font-size: 14px; font-weight: 700; }
.footer-brand .brand-sub { color: rgba(255,255,255,0.5); font-size: 10px; letter-spacing: 0.2em; }
.footer-desc { color: rgba(255,255,255,0.5); font-size: 14px; max-width: 320px; }
.footer-contact { color: rgba(255,255,255,0.6); font-size: 14px; }
.footer-contact p { margin-bottom: 4px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 24px; padding-top: 24px; text-align: center;
  color: rgba(255,255,255,0.3); font-size: 12px;
}

/* ---- FORM SCREEN ---- */
.form-container {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 24px;
}
.form-card {
  background: #fff; border-radius: 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
  padding: 32px; max-width: 420px; width: 100%;
}
.form-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; font-size: 28px;
  background: linear-gradient(135deg, #27ae60, #2ecc71); color: #fff;
}
.form-card h2 {
  font-family: var(--font-display); font-size: 1.75rem;
  text-align: center; margin-bottom: 8px; color: var(--maximus-dark);
}
.form-card .form-desc {
  text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 32px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 14px; font-weight: 600;
  margin-bottom: 6px; color: var(--text-dark);
}
.form-group input {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--border-color); background: var(--bg-light);
  font-size: 16px; font-family: var(--font-sans);
  color: var(--text-dark); outline: none; transition: all 0.2s;
}
.form-group input:focus {
  border-color: #27ae60; box-shadow: 0 0 0 3px rgba(39,174,96,0.15);
}
.form-group input::placeholder { color: var(--text-muted); }

/* ---- INSTRUCTIONS ---- */
.instruction-item {
  display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px;
}
.instruction-icon {
  width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(45,74,62,0.1); color: var(--maximus-green); font-size: 24px;
}
.instruction-step {
  font-family: var(--font-mono); font-size: 12px;
  font-weight: 700; color: var(--text-muted);
}
.instruction-title {
  font-size: 16px; font-weight: 600; margin-bottom: 4px;
}
.instruction-desc {
  font-size: 14px; color: var(--text-muted); line-height: 1.5;
}
.note-box {
  background: #fff8e1; border: 1px solid #ffe082; border-radius: 12px;
  padding: 16px; margin-bottom: 24px;
}
.note-box p { font-size: 14px; color: #7b6b2a; line-height: 1.5; }

/* ---- CALIBRATION ---- */
.calibration-icon {
  width: 80px; height: 80px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px; background: rgba(45,74,62,0.1);
  color: var(--maximus-green); font-size: 36px;
}
.volume-slider-wrap {
  display: flex; align-items: center; gap: 16px; margin-bottom: 32px; padding: 0 16px;
}
.volume-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 3px; background: var(--border-color);
  outline: none;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px;
  border-radius: 50%; background: var(--maximus-green); cursor: pointer;
}
.volume-value {
  font-family: var(--font-mono); font-size: 14px;
  font-weight: 500; width: 40px; text-align: right;
}

/* ---- TESTING SCREEN ---- */
.test-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border-color); background: #fff;
}
.test-header .logo-area { display: flex; align-items: center; gap: 8px; }
.test-header img { height: 32px; }
.test-header .brand-sm { font-size: 12px; font-weight: 700; }
.progress-circle {
  position: relative; width: 56px; height: 56px;
}
.progress-circle svg { transform: rotate(-90deg); }
.progress-circle .track { fill: none; stroke: var(--border-color); stroke-width: 4; }
.progress-circle .bar { fill: none; stroke: var(--maximus-green); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.progress-circle .label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--maximus-green);
}
.test-main {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 32px 24px;
}
.round-label {
  font-family: var(--font-mono); font-size: 14px;
  color: var(--text-muted); margin-bottom: 8px;
}
.test-title {
  font-family: var(--font-display); font-size: 1.25rem;
  font-weight: 700; margin-bottom: 32px; text-align: center;
}

/* Sound wave animation */
.wave-container {
  position: relative; width: 160px; height: 160px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 32px;
}
.wave-ring {
  position: absolute; border-radius: 50%; border: 2px solid rgba(45,74,62,0.15);
}
.wave-ring.active { border-color: rgba(39,174,96,0.4); }
.wave-center {
  position: relative; z-index: 10; width: 56px; height: 56px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--maximus-green), var(--maximus-light));
  color: #fff; font-size: 24px;
}
.wave-center.active { box-shadow: 0 0 30px rgba(39,174,96,0.3); }
@keyframes waveScale {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.15); opacity: 0.2; }
}
.wave-ring.active { animation: waveScale 1.5s ease-in-out infinite; }
.wave-ring:nth-child(1) { width: 64px; height: 64px; }
.wave-ring:nth-child(2) { width: 96px; height: 96px; animation-delay: 0.3s; }
.wave-ring:nth-child(3) { width: 128px; height: 128px; animation-delay: 0.6s; }
.wave-ring:nth-child(4) { width: 160px; height: 160px; animation-delay: 0.9s; }

/* Waveform bars */
.wave-bars {
  position: absolute; bottom: 8px; display: flex; gap: 3px; align-items: flex-end;
}
.wave-bar {
  width: 3px; border-radius: 3px; background: #2ecc71;
}
@keyframes barBounce {
  0%, 100% { height: 8px; }
  50% { height: var(--bar-h); }
}
.wave-bar.active { animation: barBounce var(--bar-dur) ease-in-out infinite; }

.replay-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 9999px; border: none;
  background: rgba(45,74,62,0.08); color: var(--maximus-green);
  font-size: 14px; font-weight: 500; cursor: pointer;
  margin-bottom: 24px; font-family: var(--font-sans);
}

/* Digit display */
.digit-display {
  display: flex; justify-content: center; gap: 16px; margin-bottom: 24px;
}
.digit-slot {
  width: 64px; height: 80px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border-color); background: var(--bg-cream);
  font-family: var(--font-mono); font-size: 2rem; font-weight: 700;
  color: var(--text-dark); transition: all 0.2s;
}
.digit-slot.filled {
  border-color: var(--maximus-green);
  background: rgba(45,74,62,0.08);
}

/* Keypad */
.keypad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; max-width: 300px; width: 100%;
}
.key {
  width: 100%; aspect-ratio: 1; border-radius: 12px; border: none;
  font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700;
  color: #fff; cursor: pointer; transition: all 0.2s;
  background: var(--maximus-green);
  box-shadow: 0 2px 8px rgba(26,46,38,0.2);
}
.key:hover { background: var(--maximus-light); transform: scale(1.05); }
.key:active { transform: scale(0.95); background: var(--maximus-dark); }
.key:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.key.delete { background: #6b7c74; }
.key.confirm { background: #2ecc71; font-size: 0.85rem; font-family: var(--font-sans); }
.key.confirm:disabled { background: #6b7c74; }

/* Progress bar */
.progress-bar-wrap { padding: 0 24px 24px; }
.progress-bar {
  width: 100%; height: 6px; border-radius: 3px;
  background: var(--border-color); overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #27ae60, #2ecc71);
  transition: width 0.5s ease;
}

/* ---- RESULTS SCREEN ---- */
.results-hero {
  position: relative; padding: 24px 24px 56px;
  background-size: cover; background-position: center;
  background-image: url('https://d2xsxph8kpxj0f.cloudfront.net/310419663028536145/FdqUefcx9YXFimxQECMzaA/results-background-U9w4RtuA4nYZ8xp6xUq6oy.webp');
}
.results-hero .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(26,46,38,0.7), rgba(26,46,38,0.85));
}
.results-hero .content { position: relative; z-index: 10; }
.results-hero h2 {
  font-family: var(--font-display); font-size: 1.75rem;
  color: #fff; text-align: center; margin-bottom: 8px;
}
.results-hero .sub { color: rgba(255,255,255,0.6); font-size: 14px; text-align: center; margin-bottom: 24px; }
.results-hero .lead-name { color: rgba(255,255,255,0.7); font-size: 14px; text-align: center; margin-bottom: 8px; }

/* Gauge */
.gauge-wrap { display: flex; justify-content: center; }
.gauge { position: relative; }
.gauge .score-num {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono);
}
.gauge .score-num .big { font-size: 3rem; font-weight: 700; }
.gauge .score-num .small { font-size: 1.1rem; color: rgba(255,255,255,0.6); }
.gauge .classification {
  display: inline-block; padding: 8px 16px; border-radius: 9999px;
  font-size: 14px; font-weight: 600; color: #fff; margin-top: 8px;
}

/* Results body */
.results-body {
  flex: 1; background: #fff; padding: 32px 24px;
  margin-top: -16px; border-radius: 24px 24px 0 0;
  position: relative; z-index: 10;
}
.results-inner { max-width: 420px; margin: 0 auto; }
.classification-box {
  padding: 20px; border-radius: 16px; margin-bottom: 24px;
  font-size: 14px; line-height: 1.6;
}
.classification-box.normal { background: #e8f5e9; }
.classification-box.leve { background: #fff8e1; }
.classification-box.moderada { background: #fff3e0; }
.classification-box.severa { background: #ffebee; }

.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-bottom: 32px;
}
.stat-card {
  text-align: center; padding: 12px; border-radius: 12px;
  background: var(--bg-light);
}
.stat-card .val {
  font-family: var(--font-mono); font-size: 1.5rem;
  font-weight: 700; color: var(--text-dark);
}
.stat-card .lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.cta-box {
  padding: 24px; border-radius: 16px; margin-bottom: 24px;
  background: linear-gradient(135deg, #2D4A3E, #1a2e26);
}
.cta-box h3 {
  font-family: var(--font-display); font-size: 1.1rem;
  color: #fff; margin-bottom: 8px;
}
.cta-box p { font-size: 14px; color: rgba(255,255,255,0.8); line-height: 1.6; margin-bottom: 16px; }

.info-card {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-radius: 12px; background: var(--bg-light);
  margin-bottom: 12px;
}
.info-card .icon { font-size: 18px; color: #27ae60; flex-shrink: 0; }
.info-card .info-title { font-size: 14px; font-weight: 600; }
.info-card .info-sub { font-size: 12px; color: var(--text-muted); }

.disclaimer-text {
  font-size: 12px; color: var(--text-muted); text-align: center;
  margin-top: 24px; line-height: 1.5;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .btn { padding: 14px 28px; font-size: 16px; }
  .digit-slot { width: 56px; height: 68px; font-size: 1.5rem; }
  .key { font-size: 1.25rem; }
}
