:root{
  --primary-color: #1a1a4d;
  --accent-color: #5a5a8a;
  --button-color: #4a4a7a;
  --bg-light: #f5f5f7;
  --card-bg: #ffffff;
  --text-dark: #2d2d2d;
  --text-muted: #757575;
  --border-color: #e0e0e0;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0,0,0,0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #e8e8eb 0%, #f5f5f7 100%);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 520px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card {
  width: 100%;
  background: var(--card-bg);
  border-radius: 24px;
  padding: 40px 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  text-align: center;
}

h1 {
  margin: 0 0 10px 0;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.5px;
}

.subtitle {
  margin: 0 0 28px 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  font-weight: 400;
}

.timer-display {
  margin: 24px 0;
}

#timer {
  font-size: 42px;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}

.waveform-container {
  display: flex;
  justify-content: center;
  margin: 22px 0 26px 0;
  padding: 0 16px;
}

canvas#wave {
  width: 100%;
  height: 70px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8f8fa 0%, #f0f0f5 100%);
  border: 1px solid var(--border-color);
  display: block;
}

.record-button-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 32px 0 28px 0;
}

.record-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: none;
  background: var(--primary-color);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(26, 26, 77, 0.25);
  transition: all 0.2s ease;
  padding: 0;
}

.record-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 14px 40px rgba(26, 26, 77, 0.35);
}

.record-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.record-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mic-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  font-size: 48px;
}

.mic-icon svg {
  width: 48px;
  height: 48px;
}

.button-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 28px 0;
}

button.btn {
  appearance: none;
  border: none;
  padding: 10px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  text-transform: capitalize;
}

button.stop-btn {
  background: #f0f0f5;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

button.stop-btn:hover:not(:disabled) {
  background: #e8e8ed;
}

button.send-btn {
  background: var(--button-color);
  color: white;
}

button.send-btn:hover:not(:disabled) {
  background: #3a3a6a;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(74, 74, 122, 0.2);
}

button.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

button.btn:active:not(:disabled) {
  transform: translateY(1px);
}

#status {
  margin-top: 16px;
  font-size: 13px;
  color: var(--accent-color);
  font-weight: 500;
  min-height: 20px;
}

#status.status-hidden {
  display: none;
}

audio#player {
  width: 100%;
  margin-top: 16px;
  border-radius: 8px;
  outline: none;
}

.footer-note {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.footer-note p {
  margin: 0;
}

@media (max-width: 480px) {
  .card {
    padding: 32px 24px;
  }

  h1 {
    font-size: 24px;
  }

  .subtitle {
    font-size: 13px;
    margin-bottom: 24px;
  }

  #timer {
    font-size: 40px;
  }

  canvas#wave {
    height: 60px;
  }

  .record-btn {
    width: 100px;
    height: 100px;
    font-size: 40px;
  }

  .button-label {
    font-size: 12px;
    letter-spacing: 1px;
  }

  button.btn {
    padding: 10px 24px;
    font-size: 13px;
  }
}

/* ===== Anteprima dimostrativa ===== */
body { padding-top: 56px; }
.demo-ribbon { position: fixed; top: 0; left: 0; right: 0; z-index: 2; text-align: center; background: var(--primary-color); color: #fff; font-weight: 700; letter-spacing: .08em; font-size: 11px; padding: 8px 12px; }
.demo-body { pointer-events: none; user-select: none; width: 100%; display: flex; justify-content: center; }
.wave { display: flex; align-items: center; justify-content: center; gap: 3px; width: 100%; height: 70px; padding: 0 12px; border-radius: 12px; background: linear-gradient(180deg, #f8f8fa 0%, #f0f0f5 100%); border: 1px solid var(--border-color); }
.wave i { display: block; width: 4px; border-radius: 2px; background: #6a5aaa; height: 20%; }
.wave i:nth-child(7n+1) { height: 28%; }
.wave i:nth-child(7n+2) { height: 52%; }
.wave i:nth-child(7n+3) { height: 78%; }
.wave i:nth-child(7n+4) { height: 44%; }
.wave i:nth-child(7n+5) { height: 90%; }
.wave i:nth-child(7n+6) { height: 62%; }
.wave i:nth-child(7n) { height: 34%; }
@media (max-width: 480px) { .wave { height: 60px; } }
