/* =========================================
   Petra Coaching — AI Maturity Assessment
   Stylesheet
   Depends on: styles.css (design tokens)
   ========================================= */

:root {
  --level-1: #94A3B8;
  --level-2: #60A5FA;
  --level-3: #34D399;
  --level-4: #F59E0B;
  --level-5: #122461;
  --am-future-bg: #F0F4FF;
}

/* ---- Container ---- */
.am-container {
  width: 90%;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 0 80px;
  min-height: calc(100vh - var(--nav-h) - 180px);
}

.am-container:has(.am-welcome) {
  max-width: 1080px;
}

/* ---- Progress Bar ---- */
.am-progress {
  margin-bottom: 36px;
}

.am-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.am-progress-track {
  height: 4px;
  background: var(--snow);
  border-radius: 2px;
  overflow: hidden;
}

.am-progress-fill {
  height: 100%;
  background: var(--navy);
  border-radius: 2px;
  transition: width 0.35s ease;
}

/* ---- Welcome Screen ---- */
.am-welcome {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.am-welcome-header {
  margin-bottom: 56px;
}

.am-welcome-header .eyebrow {
  margin-bottom: 12px;
  display: block;
}

.am-welcome h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 20px;
}

.am-welcome h1 em {
  font-style: italic;
  color: var(--navy);
}

.am-welcome-lead {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  line-height: 1.65;
  color: var(--muted);
  max-width: 580px;
  margin-bottom: 36px;
}

.am-dimensions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.am-dim-card {
  background: var(--snow);
  border-radius: 8px;
  padding: 18px 20px;
}

.am-dim-card-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 4px;
}

.am-dim-card-name {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 6px;
}

.am-dim-card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.am-welcome-meta {
  display: flex;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.am-welcome-meta span {
  font-size: 0.85rem;
  color: var(--muted);
}

.am-welcome-meta strong {
  color: var(--ink);
}

/* ---- Context Screen ---- */
.am-screen-header {
  margin-bottom: 32px;
}

.am-screen-header .eyebrow {
  display: block;
  margin-bottom: 10px;
}

.am-screen-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}

.am-screen-header p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---- Form Fields ---- */
.am-field {
  margin-bottom: 22px;
}

.am-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}

.am-field input,
.am-field select,
.am-field textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #D1D5DB;
  border-radius: 6px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

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

.am-field textarea {
  resize: vertical;
  min-height: 88px;
}

.am-field-optional {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  margin-left: 6px;
}

.am-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---- Assessment Screen ---- */
.am-dim-header {
  padding: 20px 24px;
  background: var(--navy);
  border-radius: 10px;
  margin-bottom: 32px;
  color: #fff;
}

.am-dim-header .eyebrow {
  color: rgba(255,255,255,0.55);
  display: block;
  margin-bottom: 6px;
}

.am-dim-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.am-dim-header p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.7);
  margin: 0;
}

/* ---- Likert Questions ---- */
.am-question {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.am-question:last-of-type {
  border-bottom: none;
}

.am-question-text {
  font-size: 0.97rem;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 14px;
}

.am-question-construct {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.am-likert {
  display: flex;
  gap: 0;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
}

.am-likert label {
  flex: 1;
  position: relative;
  cursor: pointer;
}

.am-likert input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.am-likert-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  background: #fff;
  border-right: 1px solid #E5E7EB;
  transition: background 0.15s;
  gap: 4px;
}

.am-likert label:last-child .am-likert-cell {
  border-right: none;
}

.am-likert-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}

.am-likert-desc {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

.am-likert input:checked + .am-likert-cell {
  background: var(--navy);
}

.am-likert input:checked + .am-likert-cell .am-likert-val,
.am-likert input:checked + .am-likert-cell .am-likert-desc {
  color: #fff;
}

.am-likert label:hover .am-likert-cell {
  background: var(--snow);
}

.am-likert input:checked + .am-likert-cell:hover {
  background: var(--navy);
}

.am-likert input:focus-visible + .am-likert-cell {
  outline: 2px solid var(--navy);
  outline-offset: -2px;
}

/* ---- Future State Question ---- */
.am-future-question {
  background: var(--am-future-bg);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 28px;
}

.am-future-question .am-question-text {
  font-weight: 600;
  margin-bottom: 16px;
}

.am-level-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.am-level-option {
  position: relative;
}

.am-level-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.am-level-option-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 14px;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.2s, background 0.2s;
  gap: 2px;
  min-width: 80px;
  text-align: center;
}

.am-level-option input:checked + .am-level-option-label {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.am-level-option-num {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}

.am-level-option-name {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.am-level-option input:checked + .am-level-option-label .am-level-option-num,
.am-level-option input:checked + .am-level-option-label .am-level-option-name {
  color: #fff;
}

/* ---- Navigation Buttons ---- */
.am-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.am-nav .btn-back {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.am-nav .btn-back:hover { color: var(--ink); }

.am-error {
  font-size: 0.82rem;
  color: #C62828;
  margin-top: -12px;
  margin-bottom: 16px;
  display: none;
}

.am-error.visible { display: block; }

/* ---- Email Screen ---- */
.am-email-screen {
  max-width: 540px;
}

.am-email-icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
}

/* ---- Results Screen ---- */
.am-results {
  max-width: 780px;
  margin: 0 auto;
}

.am-results-hero {
  background: var(--navy);
  border-radius: 14px;
  padding: 36px 40px;
  color: #fff;
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.am-level-badge {
  flex-shrink: 0;
  text-align: center;
}

.am-level-badge-num {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.am-level-badge-name {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}

.am-results-hero-text h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.am-results-hero-text p {
  color: rgba(255,255,255,0.75);
  font-size: 0.93rem;
  line-height: 1.65;
  margin: 0;
}

.am-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

@media (max-width: 640px) {
  .am-results-grid { grid-template-columns: 1fr; }
  .am-field-row { grid-template-columns: 1fr; }
  .am-likert-desc { display: none; }
  .am-results-hero { padding: 24px; gap: 20px; }
  .am-level-badge-num { width: 64px; height: 64px; font-size: 1.6rem; }
  .am-chart-wrap { height: 200px; }
}

/* ---- Required field indicator ---- */
.am-field-req {
  color: #C62828;
  margin-left: 3px;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
}

.am-results-card {
  background: var(--snow);
  border-radius: 10px;
  padding: 24px;
}

.am-results-card h3 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

/* Radar chart container */
.am-chart-wrap {
  position: relative;
  height: 260px;
}

/* Dimension bars */
.am-dim-bar {
  margin-bottom: 14px;
}

.am-dim-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 5px;
  color: var(--ink);
}

.am-dim-bar-label span:last-child {
  font-weight: 600;
  color: var(--navy);
}

.am-dim-bar-track {
  height: 8px;
  background: #E5E7EB;
  border-radius: 4px;
  overflow: visible;
  position: relative;
}

.am-dim-bar-fill {
  height: 100%;
  min-width: 3px;
  background: var(--navy);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Target marker on dimension bar */
.am-dim-bar-target {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 16px;
  background: var(--amber);
  border-radius: 2px;
  transform: translateX(-50%);
}

/* Gap badges */
.am-gap-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--amber-text);
  background: rgba(244,165,0,0.12);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}
.am-gap-badge.am-gap-met {
  color: var(--emerald);
  background: rgba(34,88,87,0.1);
}

/* Role lens */
.am-role-lens {
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
}

.am-role-lens h3 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.am-role-lens p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink);
  margin: 0;
}

/* Priority areas */
.am-priorities {
  margin-bottom: 24px;
}

.am-priorities h3 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.am-priority-item {
  background: #FFF7ED;
  border-left: 3px solid #F59E0B;
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.am-priority-item h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.am-priority-item p {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* Callout strips */
.am-callout {
  background: var(--snow);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.am-callout-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.am-callout-text {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink);
}

.am-callout-text strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

/* CTA */
.am-results-cta {
  background: var(--navy);
  border-radius: 12px;
  padding: 32px 36px;
  text-align: center;
  margin-top: 36px;
}

.am-results-cta h3 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.am-results-cta p {
  color: rgba(255,255,255,0.75);
  font-size: 0.93rem;
  margin-bottom: 22px;
}

.am-magic-link-note {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* Loading state */
.am-loading {
  text-align: center;
  padding: 80px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.am-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: am-spin 0.7s linear infinite;
  margin: 0 auto 16px;
}

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