@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,500;0,9..144,700;1,9..144,400&family=Inter:wght@400;500;600&display=swap');

:root {
  --green: #115430;
  --green-light: #66BA24;
  --dark: #1E2220;
  --beige: #F5F0ED;
  --beige-dark: #DFDAD7;
  --red: #F83636;
  --white: #FFFFFF;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--dark);
  background: var(--beige);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  line-height: 1.3;
}

/* Layout */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide {
  max-width: 1100px;
}

/* Progress Bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--beige-dark);
  padding: 16px 24px;
}

.progress-bar__inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-bar__logo {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px;
  color: var(--green);
  font-weight: 700;
  white-space: nowrap;
}

.progress-bar__steps {
  display: flex;
  gap: 6px;
  flex: 1;
}

.progress-bar__step {
  height: 4px;
  flex: 1;
  background: var(--beige-dark);
  border-radius: 2px;
  transition: background 0.3s;
}

.progress-bar__step--active {
  background: var(--green);
}

.progress-bar__step--complete {
  background: var(--green-light);
}

.progress-bar__label {
  font-size: 13px;
  color: #888;
  white-space: nowrap;
}

.progress-bar__save {
  font-size: 12px;
  color: var(--green-light);
  opacity: 0;
  transition: opacity 0.3s;
}

.progress-bar__save--visible {
  opacity: 1;
}

/* Page sections */
.page {
  padding-top: 80px;
  padding-bottom: 60px;
  min-height: 100vh;
}

.page__header {
  text-align: center;
  margin-bottom: 48px;
  padding-top: 40px;
}

.page__header h1 {
  font-size: 32px;
  color: var(--green);
  margin-bottom: 12px;
}

.page__header p {
  font-size: 16px;
  color: #666;
  max-width: 480px;
  margin: 0 auto;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.card__title {
  font-size: 20px;
  color: var(--green);
  margin-bottom: 20px;
}

/* Form elements */
.field {
  margin-bottom: 20px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--dark);
}

.field label .required {
  color: var(--red);
  margin-left: 2px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="url"],
.field select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--beige-dark);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--green);
}

.field textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--beige-dark);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--dark);
  background: var(--white);
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s;
}

.field__hint {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.field__counter {
  font-size: 12px;
  color: #999;
  text-align: right;
  margin-top: 4px;
}

.field__counter--over {
  color: var(--red);
}

.field__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* File upload */
.file-upload {
  border: 2px dashed var(--beige-dark);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.file-upload:hover {
  border-color: var(--green);
  background: rgba(17, 84, 48, 0.02);
}

.file-upload--has-file {
  border-color: var(--green-light);
  background: rgba(102, 186, 36, 0.04);
}

.file-upload input {
  display: none;
}

.file-upload__label {
  font-size: 14px;
  color: #888;
}

.file-upload__name {
  font-size: 14px;
  color: var(--green);
  font-weight: 500;
  margin-top: 4px;
}

/* Video recorder */
.video-recorder {
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  position: relative;
}

.video-recorder video {
  width: 100%;
  display: block;
}

.video-recorder__controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: rgba(0,0,0,0.7);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.video-recorder__timer {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.video-recorder__timer--recording {
  background: var(--red);
}

.video-recorder__status {
  text-align: center;
  padding: 60px 24px;
  color: #ccc;
  font-size: 14px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn--primary {
  background: var(--green);
  color: var(--beige);
}

.btn--primary:hover {
  background: #0d4025;
}

.btn--primary:disabled {
  background: #999;
  cursor: not-allowed;
}

.btn--secondary {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
}

.btn--secondary:hover {
  background: rgba(17, 84, 48, 0.05);
}

.btn--danger {
  background: var(--red);
  color: var(--white);
}

.btn--small {
  padding: 8px 16px;
  font-size: 13px;
}

.btn--full {
  width: 100%;
}

.btn--record {
  background: var(--red);
  color: var(--white);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  padding: 0;
}

.btn--record--stop {
  border-radius: 8px;
  width: 48px;
  height: 48px;
}

/* Landing page */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
}

.landing__logo {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 28px;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 8px;
}

.landing__subtitle {
  font-size: 14px;
  color: #888;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 48px;
}

.landing h1 {
  font-size: 40px;
  color: var(--dark);
  margin-bottom: 16px;
  max-width: 560px;
}

.landing p {
  font-size: 17px;
  color: #666;
  max-width: 440px;
  margin-bottom: 40px;
}

.landing__form {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 440px;
}

.landing__form input {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--beige-dark);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  background: var(--white);
}

.landing__form input:focus {
  outline: none;
  border-color: var(--green);
}

.landing__sent {
  display: none;
  padding: 20px;
  background: rgba(17, 84, 48, 0.06);
  border-radius: var(--radius);
  color: var(--green);
  max-width: 440px;
}

/* Alerts */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
}

.alert--error {
  background: rgba(248, 54, 54, 0.08);
  color: var(--red);
  border: 1px solid rgba(248, 54, 54, 0.2);
}

.alert--success {
  background: rgba(102, 186, 36, 0.08);
  color: var(--green);
  border: 1px solid rgba(102, 186, 36, 0.2);
}

/* Stage complete overlay */
.stage-complete {
  position: fixed;
  inset: 0;
  background: rgba(30, 34, 32, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.stage-complete--visible {
  opacity: 1;
  pointer-events: all;
}

.stage-complete__card {
  background: var(--white);
  border-radius: 12px;
  padding: 48px;
  text-align: center;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.stage-complete__card h2 {
  color: var(--green);
  font-size: 28px;
  margin-bottom: 12px;
}

.stage-complete__card p {
  color: #666;
  margin-bottom: 28px;
}

/* Email Scenarios & Timers */
.scenario-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.scenario-header .card__title {
  margin-bottom: 0;
}

.scenario-timer {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-display {
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--green);
  background: rgba(17, 84, 48, 0.06);
  padding: 6px 14px;
  border-radius: 6px;
}

.timer-display--warning {
  color: #856404;
  background: rgba(255, 193, 7, 0.12);
}

.timer-display--critical {
  color: var(--red);
  background: rgba(248, 54, 54, 0.08);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.scenario-context {
  background: var(--beige);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #444;
  border-left: 3px solid var(--green);
}

.scenario-locked {
  text-align: center;
  padding: 20px 0;
}

.scenario-content textarea {
  min-height: 160px;
}

.scenario-content input:disabled,
.scenario-content textarea:disabled {
  background: var(--beige);
  color: #888;
  cursor: not-allowed;
}

/* Call Simulation */
.audio-bar {
  width: 4px;
  height: 8px;
  background: var(--green);
  border-radius: 2px;
  animation: audioWave 0.8s ease-in-out infinite;
}

.audio-bar:nth-child(2) { animation-delay: 0.1s; }
.audio-bar:nth-child(3) { animation-delay: 0.2s; }
.audio-bar:nth-child(4) { animation-delay: 0.3s; }
.audio-bar:nth-child(5) { animation-delay: 0.4s; }
.audio-bar:nth-child(6) { animation-delay: 0.3s; }
.audio-bar:nth-child(7) { animation-delay: 0.2s; }
.audio-bar:nth-child(8) { animation-delay: 0.1s; }
.audio-bar:nth-child(9) { animation-delay: 0.05s; }

@keyframes audioWave {
  0%, 100% { height: 8px; }
  50% { height: 28px; }
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--beige-dark);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .card { padding: 24px 20px; }
  .field__row { grid-template-columns: 1fr; }
  .landing h1 { font-size: 28px; }
  .landing__form { flex-direction: column; }
  .page__header h1 { font-size: 26px; }
}
