/* Nabeghe Level Assessment - Mobile-first, Orange #ffa823 + Purple #7b59e3 */

.nla-app {
  --nla-orange: #ffa823;
  --nla-purple: #7b59e3;
  --nla-orange-light: #fff4e0;
  --nla-purple-light: #f0ebfc;
  --nla-text: #1a1a2e;
  --nla-muted: #6b7280;
  --nla-radius: 16px;
  --nla-shadow: 0 12px 40px rgba(123, 89, 227, 0.15);
  font-family: "Vazirmatn", "Tahoma", "Segoe UI", sans-serif;
  position: relative;
  max-width: 480px;
  margin: 1.5rem auto;
  padding: 0 1rem 2rem;
  box-sizing: border-box;
}

.nla-app *,
.nla-app *::before,
.nla-app *::after {
  box-sizing: border-box;
}

.nla-bg-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.nla-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  animation: nlaFloat 8s ease-in-out infinite;
}

.nla-shape-1 {
  width: 180px;
  height: 180px;
  background: var(--nla-orange);
  top: -40px;
  right: -30px;
}

.nla-shape-2 {
  width: 140px;
  height: 140px;
  background: var(--nla-purple);
  bottom: 20%;
  left: -40px;
  animation-delay: -3s;
}

.nla-shape-3 {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--nla-orange), var(--nla-purple));
  top: 40%;
  right: 10%;
  animation-delay: -5s;
}

@keyframes nlaFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12px, -16px) scale(1.05); }
}

.nla-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: calc(var(--nla-radius) + 4px);
  box-shadow: var(--nla-shadow);
  padding: 1.5rem 1.25rem 1.75rem;
  animation: nlaSlideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes nlaSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nla-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.nla-logo-badge {
  display: inline-flex;
  margin-bottom: 0.75rem;
  animation: nlaPulse 2s ease-in-out infinite;
}

@keyframes nlaPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.nla-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
  background: linear-gradient(135deg, var(--nla-orange), var(--nla-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nla-subtitle {
  font-size: 0.875rem;
  color: var(--nla-muted);
  margin: 0;
  line-height: 1.6;
}

/* Steps */
.nla-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1rem;
}

.nla-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 0 0 auto;
  opacity: 0.45;
  transition: opacity 0.3s, transform 0.3s;
}

.nla-step-item span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--nla-purple-light);
  color: var(--nla-purple);
  transition: all 0.35s;
}

.nla-step-item small {
  font-size: 0.65rem;
  color: var(--nla-muted);
  white-space: nowrap;
}

.nla-step-item.active span,
.nla-step-item.done span {
  background: linear-gradient(135deg, var(--nla-orange), var(--nla-purple));
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 168, 35, 0.4);
}

.nla-step-item.active,
.nla-step-item.done {
  opacity: 1;
}

.nla-step-line {
  flex: 1;
  max-width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--nla-orange), var(--nla-purple));
  opacity: 0.25;
  margin: 0 4px;
  margin-bottom: 1rem;
}

.nla-progress-wrap {
  height: 4px;
  background: var(--nla-purple-light);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.nla-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--nla-orange), var(--nla-purple));
  border-radius: 4px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Form */
.nla-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nla-field label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--nla-text);
  margin-bottom: 0.35rem;
}

.nla-required {
  font-size: 0.72rem;
  font-weight: 600;
  color: #e89410;
}

.nla-field input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid #e8e4f0;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #faf9fc;
}

.nla-field input:focus {
  outline: none;
  border-color: var(--nla-purple);
  box-shadow: 0 0 0 3px rgba(123, 89, 227, 0.15);
  background: #fff;
}

.nla-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.nla-field-row--2 {
  grid-template-columns: 1fr 1fr;
  align-items: end;
}

.nla-field-row--2 .nla-field--grow {
  min-width: 0;
}

.nla-field--age input {
  text-align: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

@media (max-width: 520px) {
  .nla-field-row--2 {
    grid-template-columns: 1fr;
  }
}

/* Payment step */
.nla-payment-box {
  text-align: center;
  padding: 0.5rem 0 1rem;
}

.nla-payment-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--nla-purple);
  margin: 0 0 0.75rem;
}

.nla-payment-intro {
  font-size: 0.9rem;
  color: var(--nla-muted);
  line-height: 1.7;
  margin: 0 0 1.25rem;
}

.nla-payment-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--nla-orange-light), var(--nla-purple-light));
}

.nla-payment-amount strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--nla-purple);
}

.nla-payment-label {
  font-size: 0.85rem;
  color: var(--nla-muted);
}

#nla-retake-quiz-btn {
  margin-top: 0.5rem;
}

/* Result panel toolbar */
.nla-panel--has-toolbar {
  position: relative;
  padding-top: 2.75rem;
}

.nla-retest-btn {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border: 2px solid var(--nla-purple-light);
  border-radius: 999px;
  background: #fff;
  color: var(--nla-purple);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  z-index: 2;
  max-width: calc(100% - 0.5rem);
}

.nla-retest-btn:hover {
  border-color: var(--nla-purple);
  background: var(--nla-purple-light);
}

.nla-retest-btn svg {
  flex-shrink: 0;
}

.nla-retest-btn[hidden] {
  display: none !important;
}

@media (max-width: 400px) {
  .nla-retest-btn span {
    display: none;
  }

  .nla-retest-btn {
    padding: 0.5rem;
    border-radius: 50%;
  }
}

/* Buttons */
.nla-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  width: 100%;
}

.nla-btn:active {
  transform: scale(0.98);
}

.nla-btn-primary {
  background: linear-gradient(135deg, var(--nla-orange), #e89410);
  color: #fff;
  box-shadow: 0 6px 20px rgba(255, 168, 35, 0.45);
}

.nla-btn-primary:hover {
  box-shadow: 0 8px 28px rgba(255, 168, 35, 0.55);
}

.nla-btn-secondary {
  background: linear-gradient(135deg, var(--nla-purple), #6a4fd4);
  color: #fff;
  box-shadow: 0 6px 20px rgba(123, 89, 227, 0.35);
}

.nla-btn-ghost {
  background: var(--nla-purple-light);
  color: var(--nla-purple);
  width: auto;
  flex: 1;
}

.nla-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.nla-quiz-nav {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.nla-quiz-nav .nla-btn-primary {
  flex: 2;
}

/* Quiz */
.nla-quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

.nla-group-badge {
  background: linear-gradient(135deg, var(--nla-orange-light), var(--nla-purple-light));
  color: var(--nla-purple);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
}

.nla-q-counter {
  color: var(--nla-muted);
  font-weight: 600;
}

.nla-question-slide {
  min-height: 200px;
  animation: nlaFadeIn 0.4s ease;
}

@keyframes nlaFadeIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.nla-question-slide.nla-exit {
  animation: nlaFadeOut 0.25s ease forwards;
}

@keyframes nlaFadeOut {
  to { opacity: 0; transform: translateX(-12px); }
}

.nla-q-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--nla-text);
  margin: 0 0 1rem;
  line-height: 1.7;
}

.nla-q-figure {
  margin: 0 0 1rem;
  text-align: center;
}

.nla-q-image {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 220px;
  margin: 0 auto;
  border-radius: 12px;
  object-fit: contain;
}

.nla-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.nla-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.nla-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nla-option-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 2px solid #ebe8f2;
  border-radius: 14px;
  background: #faf9fc;
  transition: all 0.25s;
  font-size: 0.95rem;
  line-height: 1.5;
}

.nla-option-inner::before {
  content: "";
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #d1cce0;
  transition: all 0.25s;
}

.nla-option input:checked + .nla-option-inner {
  border-color: var(--nla-purple);
  background: var(--nla-purple-light);
  box-shadow: 0 4px 16px rgba(123, 89, 227, 0.15);
}

.nla-option input:checked + .nla-option-inner::before {
  border-color: var(--nla-purple);
  background: var(--nla-purple);
  box-shadow: inset 0 0 0 4px #fff;
}

.nla-option:active .nla-option-inner {
  transform: scale(0.99);
}

/* Result */
.nla-result-hero {
  text-align: center;
  padding: 0.5rem 0 1rem;
  animation: nlaSlideUp 0.5s ease;
}

.nla-score-ring {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 1.25rem;
}

.nla-score-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.nla-score-bg {
  fill: none;
  stroke: var(--nla-purple-light);
  stroke-width: 8;
}

.nla-score-fill {
  fill: none;
  stroke: url(#nlaScoreGrad);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.nla-score-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.nla-score-main {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.15rem;
  direction: ltr;
}

.nla-score-value #nla-score-number {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--nla-orange), var(--nla-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nla-score-of {
  font-size: 1rem;
  font-weight: 600;
  color: var(--nla-muted);
}

.nla-score-value small {
  font-size: 0.7rem;
  color: var(--nla-muted);
}

.nla-result-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--nla-purple);
  margin: 0 0 0.75rem;
}

.nla-result-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--nla-text);
  text-align: right;
  background: linear-gradient(135deg, var(--nla-orange-light), var(--nla-purple-light));
  padding: 1rem 1.1rem;
  border-radius: var(--nla-radius);
  margin-bottom: 1.25rem;
}

.nla-result-text p {
  margin: 0 0 0.5rem;
}

.nla-result-text p:last-child {
  margin-bottom: 0;
}

.nla-result-actions {
  margin-top: 1.25rem;
}

.nla-result-actions[hidden],
.nla-btn-buy-lower[hidden] {
  display: none !important;
}

.nla-btn-buy,
.nla-btn-buy-lower {
  text-decoration: none;
  display: inline-flex;
  max-width: 320px;
  margin: 0 auto;
}

.nla-experience-box {
  padding: 0.25rem 0 0.5rem;
}

.nla-experience-question {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.7;
  margin: 0 0 1rem;
  color: var(--nla-text);
}

.nla-experience-options {
  margin-bottom: 1.25rem;
}

.nla-track-results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.nla-track-results[hidden] {
  display: none !important;
}

.nla-track-result-card {
  padding: 1rem 1.1rem;
  border-radius: var(--nla-radius);
  border: 1px solid rgba(123, 89, 227, 0.18);
  background: linear-gradient(135deg, var(--nla-orange-light), var(--nla-purple-light));
}

.nla-track-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.nla-track-result-label {
  font-weight: 700;
  color: var(--nla-purple);
}

.nla-track-result-score {
  font-size: 0.85rem;
  color: var(--nla-muted);
}

.nla-track-result-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.nla-track-result-text {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--nla-text);
}

.nla-track-result-buy {
  margin-top: 0.85rem;
  width: 100%;
  text-align: center;
}

.nla-track-result-card--primary {
  border-width: 2px;
  border-color: rgba(255, 168, 35, 0.45);
}

.nla-lower-suggestion {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: var(--nla-radius);
  border: 2px dashed rgba(123, 89, 227, 0.35);
  background: #faf9fc;
  animation: nlaSlideUp 0.5s ease 0.15s both;
}

.nla-lower-suggestion[hidden] {
  display: none !important;
}

.nla-lower-intro {
  font-size: 0.85rem;
  color: var(--nla-muted);
  margin: 0 0 0.65rem;
  line-height: 1.6;
}

.nla-lower-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--nla-orange);
  margin: 0 0 0.5rem;
}

.nla-lower-text {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--nla-text);
  margin-bottom: 1rem;
}

.nla-lower-text p {
  margin: 0 0 0.5rem;
}

/* Alert & loading */
.nla-alert {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  animation: nlaShake 0.4s ease;
}

.nla-alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

@keyframes nlaShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.nla-panel {
  display: none;
}

.nla-panel.active {
  display: block;
}

.nla-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 10;
}

.nla-loading[hidden] {
  display: none !important;
}

.nla-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--nla-purple-light);
  border-top-color: var(--nla-orange);
  border-radius: 50%;
  animation: nlaSpin 0.8s linear infinite;
  margin-bottom: 0.75rem;
}

@keyframes nlaSpin {
  to { transform: rotate(360deg); }
}

/* SVG gradient for score ring - injected via JS */
.nla-app svg defs linearGradient#nlaScoreGrad stop:first-child { stop-color: #ffa823; }
.nla-app svg defs linearGradient#nlaScoreGrad stop:last-child { stop-color: #7b59e3; }

.nla-returning-notice {
  background: var(--nla-purple-light);
  color: var(--nla-purple);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0 0 1rem;
  text-align: center;
}

.nla-returning-notice[hidden] {
  display: none !important;
}

/* Tablet */
@media (min-width: 600px) {
  .nla-app {
    max-width: 560px;
  }
}

/* Desktop — wider layout, not phone-sized */
@media (min-width: 768px) {
  .nla-app {
    max-width: 720px;
    margin: 2.5rem auto;
    padding: 0 1.5rem 3rem;
  }

  .nla-card {
    padding: 2.25rem 2.5rem 2.5rem;
  }

  .nla-title {
    font-size: 1.65rem;
  }

  .nla-form--info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
  }

  .nla-form--info .nla-field-full {
    grid-column: 1 / -1;
  }

  .nla-field-row {
    grid-column: 1 / -1;
  }

  .nla-quiz-nav .nla-btn {
    max-width: 220px;
  }

  .nla-quiz-nav {
    justify-content: center;
  }

  .nla-score-ring {
    width: 168px;
    height: 168px;
  }

  .nla-score-value #nla-score-number {
    font-size: 2.35rem;
  }

  .nla-result-text {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 1024px) {
  .nla-app {
    max-width: 860px;
  }

  .nla-card {
    padding: 2.5rem 3rem 3rem;
  }

  .nla-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .nla-q-text {
    font-size: 1.15rem;
  }
}
