/* ========================================
   PPT Assessment — M.Agile Consulting
   ======================================== */

/* ---------- Design Tokens ---------- */
:root {
  --primary: #002B7B;
  --primary-hover: #001f5c;
  --accent: #BDE9FB;
  --bg: #F6F6F6;
  --white: #FFFFFF;
  --text: #1a1a2e;
  --text-light: #555;
  --border: #e0e0e0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.10);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Dimension colors */
  --people-color: #002B7B;
  --process-color: #2c7a7b;
  --tech-color: #dd6b20;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--primary);
  color: var(--white);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 12px rgba(0, 43, 123, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-placeholder {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

.header-tagline {
  font-size: 0.85rem;
  opacity: 0.85;
  font-weight: 500;
}

/* ---------- Main container ---------- */
.app-container {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  flex: 1;
}

/* ---------- View management ---------- */
.view {
  display: none;
  animation: fadeIn 0.4s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Card ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

/* ---------- Welcome ---------- */
.welcome-card {
  text-align: center;
  padding: 3.5rem 2.5rem;
}

.welcome-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.welcome-card h1 {
  color: var(--primary);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.welcome-subtitle {
  color: var(--primary);
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.welcome-body {
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  font-size: 0.95rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.8rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  gap: 0.4rem;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 43, 123, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

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

.btn-secondary:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-lg {
  padding: 0.9rem 2.5rem;
  font-size: 1.05rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.required {
  color: #e53e3e;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 43, 123, 0.1);
}

.form-group input.input-error,
.form-group select.input-error {
  border-color: #e53e3e;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  gap: 1rem;
}

.section-desc {
  color: var(--text-light);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* ---------- Section heading (survey) ---------- */
.section-heading {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--accent);
}

.section-heading h2 {
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.section-subtitle {
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---------- Progress bar ---------- */
.progress-wrapper {
  margin-bottom: 2rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

#progress-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--white);
}

.category-badge.cat-people {
  background: var(--people-color);
}

.category-badge.cat-process {
  background: var(--process-color);
}

.category-badge.cat-technology {
  background: var(--tech-color);
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #3b82f6);
  border-radius: 10px;
  transition: width 0.4s ease;
}

/* ---------- Survey question ---------- */
.survey-card {
  padding: 2rem 2.5rem 2rem;
}

.question-instruction {
  font-size: 0.85rem;
  color: #999;
  font-weight: 500;
  margin-bottom: 0.6rem;
  font-style: italic;
}

#question-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.option-item {
  position: relative;
}

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

.option-label {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.95rem;
  transition: all var(--transition);
  background: var(--bg);
}

.option-label:hover {
  border-color: var(--primary);
  background: rgba(0, 43, 123, 0.03);
}

.option-radio-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.option-radio-circle::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  transform: scale(0);
  transition: transform var(--transition);
}

.option-item input[type="radio"]:checked+.option-label {
  border-color: var(--primary);
  background: rgba(0, 43, 123, 0.06);
}

.option-item input[type="radio"]:checked+.option-label .option-radio-circle {
  border-color: var(--primary);
}

.option-item input[type="radio"]:checked+.option-label .option-radio-circle::after {
  transform: scale(1);
}

.survey-nav {
  margin-top: 2rem;
}

/* ---------- Results ---------- */
.results-header-card {
  text-align: center;
}

.results-header-card h2 {
  color: var(--primary);
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
}

/* Label badge */
.label-badge {
  display: inline-block;
  padding: 0.65rem 2rem;
  border-radius: 30px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.3px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Results grid */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.chart-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

#radar-chart {
  max-width: 360px;
  max-height: 360px;
}

.scores-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: center;
}

.dimension-block {
  padding: 1.2rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.dim-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.dim-people {
  color: var(--people-color);
}

.dim-process {
  color: var(--process-color);
}

.dim-technology {
  color: var(--tech-color);
}

.dim-score-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

/* Label description */
.label-desc-card {
  text-align: center;
}

.label-description {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  max-width: 700px;
  margin: 0 auto;
}

/* Results divider */
.results-divider {
  border: none;
  border-top: 2px solid var(--border);
  margin: 0.5rem 0 2rem;
}

/* ---------- Guard ---------- */
.guard-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 1rem;
}

#results-guard {
  text-align: center;
  max-width: 500px;
  margin: 4rem auto;
}

#results-guard h2 {
  color: var(--primary);
  margin-bottom: 1rem;
}

/* ---------- Email gate ---------- */
.email-card h3 {
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.email-card>p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.email-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.email-input-row input {
  flex: 1;
  padding: 0.8rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg);
  transition: border-color var(--transition);
}

.email-input-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 43, 123, 0.1);
}

.error-msg {
  color: #e53e3e;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.success-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f0fff4;
  border: 1px solid #c6f6d5;
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
}

.success-icon {
  font-size: 1.5rem;
}

.success-box p {
  color: #276749;
  font-size: 0.95rem;
}

/* Final CTA */
.final-cta-card {
  text-align: center;
}

.final-cta-card p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

.cta-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cta-link:hover {
  color: var(--primary-hover);
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .app-container {
    padding: 1.25rem 1rem 3rem;
  }

  .card {
    padding: 1.5rem;
  }

  .welcome-card {
    padding: 2rem 1.5rem;
  }

  .welcome-card h1 {
    font-size: 1.5rem;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .email-input-row {
    flex-direction: column;
  }

  .header-tagline {
    display: none;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
  }

  .survey-nav {
    flex-wrap: wrap;
  }

  .survey-nav .btn {
    flex: 1;
    min-width: 120px;
  }
}

@media (max-width: 480px) {
  .welcome-card h1 {
    font-size: 1.25rem;
  }

  .btn-lg {
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
  }

  .label-badge {
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
  }
}