@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Inter:wght@400;500;600&display=swap');

:root {
  --burgundy: #6B1A2A;
  --burgundy-deep: #4A1020;
  --burgundy-soft: #F7EDEF;
  --gold: #C8923A;
  --gold-light: #FDF4E7;
  --cream: #FDFAF7;
  --dark: #1A1A1A;
  --mid: #555555;
  --light: #F2EEEF;
  --border: #E0CDD0;
  --backdrop: #F0EBEC;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--dark);
  background: var(--backdrop);
}

.ala-page {
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  box-shadow: 0 4px 40px rgba(74, 16, 32, 0.13);
}

@media (min-width: 560px) {
  .ala-page {
    margin: 24px auto;
    min-height: 0;
    border-radius: 4px;
    overflow: hidden;
  }
}

/* Header */
.ala-header {
  background: var(--burgundy-deep);
  padding: 28px 24px 20px;
}

.ala-header-inner {
  text-align: center;
}

.ala-header-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
  margin: 0 0 6px;
}

.ala-header-tagline {
  font-size: 0.7rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.ala-gold-strip {
  height: 4px;
  background: var(--gold);
}

/* Main */
.ala-main {
  padding: 24px 20px 60px;
}

.ala-main h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--burgundy);
  margin: 0 0 16px;
}

.ala-main h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--burgundy);
  margin: 0;
  font-weight: 700;
}

/* Section title: gold bar + serif heading */
.ala-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}

.ala-section-title .ala-bar {
  width: 4px;
  height: 20px;
  background: var(--gold);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Fields */
.ala-field {
  margin-bottom: 16px;
}

.ala-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--dark);
}

.ala-field input[type="email"],
.ala-field input[type="password"],
.ala-field input[type="text"],
.ala-field input[type="number"],
.ala-field textarea,
.ala-field select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--dark);
  background: #fff;
}

.ala-field input[type="file"] {
  width: 100%;
  padding: 10px 0;
  font-size: 0.9rem;
}

/* Buttons */
.ala-button {
  display: inline-block;
  width: 100%;
  padding: 14px;
  background: var(--burgundy);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.ala-button:active {
  opacity: 0.85;
}

.ala-button-secondary {
  background: #fff;
  color: var(--burgundy);
  border: 1px solid var(--burgundy);
}

/* Compact modifier: for secondary/control actions (step nav, recorder
   controls) so they read as a lighter cluster, not the same weight as
   the one primary action per screen (Log In / Continue / Submit Session). */
.ala-button-sm {
  width: auto;
  flex: 0 0 auto;
  min-width: 110px;
  min-height: 40px;
  padding: 10px 16px;
  font-size: 0.85rem;
}

.ala-step-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Back/Next (and a lone Next or Back) split the row evenly instead of
   floating left with dead space on the right -- overrides -sm's
   flex: 0 0 auto via selector specificity, keeps its padding/font-size. */
.ala-step-actions > .ala-button {
  flex: 1 1 0;
}

/* Record/Stop/Re-record are mutually exclusive -- only one is ever
   visible at a time -- so they're plain full-width .ala-button (no
   modifier needed), just stacked vertically with the audio preview. */
.ala-recorder-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Error / muted / accent text */
.ala-error {
  background: var(--burgundy-soft);
  color: var(--burgundy);
  border: 1px solid var(--border);
  border-left: 3px solid var(--burgundy);
  padding: 10px 12px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.ala-accent {
  color: var(--gold);
}

.ala-muted {
  color: var(--mid);
  font-size: 0.9rem;
}

.ala-optional {
  color: var(--mid);
  font-weight: 400;
  font-size: 0.8rem;
}

.ala-encouraged {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.8rem;
}

/* Pre-session brief card */
.ala-brief {
  background: var(--burgundy-soft);
  border: 1px solid var(--border);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.ala-brief h2 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

#brief-detail-wrap {
  margin-top: 4px;
}

#brief-detail-wrap summary {
  cursor: pointer;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
}

#brief-detail-wrap[open] summary {
  margin-bottom: 8px;
}

.ala-brief-detail-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.ala-brief-detail-row:first-of-type {
  border-top: none;
}

.ala-brief-detail-row strong {
  font-size: 0.8rem;
  color: var(--gold);
}

#analyzing-message::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid var(--gold);
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: ala-spin 0.8s linear infinite;
}

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

/* Post-submit worksheet result cards */
.ala-worksheet-card {
  background: var(--gold-light);
  border-left: 3px solid var(--gold);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.ala-worksheet-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--burgundy);
  margin: 0 0 6px;
}

/* Voice recorder widgets */
.ala-recorder {
  margin: 16px 0;
}

.ala-recorder .ala-audio-preview {
  display: block;
  width: 100%;
  margin: 12px 0;
}

/* Review list -- safe bullet technique, no display:flex on <li> */
.ala-review-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.ala-review-list li {
  padding: 10px 0 10px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  position: relative;
}

.ala-review-list li::before {
  content: "\2022";
  color: var(--gold);
  position: absolute;
  left: 0;
  font-size: 1.1rem;
  line-height: 1.3;
}

/* Stepper */
.ala-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.ala-stepper button {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 4px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--mid);
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
}

.ala-stepper button.ala-step-current {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: #fff;
}

.ala-stepper button.ala-step-visited:not(.ala-step-current) {
  border-color: var(--gold);
  color: var(--burgundy);
}

/* Footer */
.ala-footer {
  background: var(--burgundy-deep);
}

.ala-footer-gold {
  height: 3px;
  background: var(--gold);
}

.ala-footer-inner {
  padding: 14px 24px 16px;
  text-align: center;
}

.ala-footer-sig {
  font-size: 0.75rem;
  font-style: italic;
  color: #fff;
  font-weight: 600;
  margin-bottom: 2px;
}

.ala-footer-sub {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.04em;
}
