@import url('brand.css');
@import url('components.css');

/* ---- Base typography ---- */
html {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: inherit;
  color: var(--lx-text);
  background: var(--lx-bg);
}

.lx-hidden { display: none !important; }

.lx-input,
.lx-select,
.lx-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--lx-surface);
  border: 1px solid var(--lx-border);
  border-radius: 10px;
  color: var(--lx-text);
  font-family: inherit;
  font-size: 1rem;
  direction: rtl;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--lx-shadow-sm);
  box-sizing: border-box;
}

.lx-input::placeholder,
.lx-textarea::placeholder {
  color: var(--lx-muted);
  opacity: 1;
}

.lx-input:focus,
.lx-select:focus,
.lx-textarea:focus {
  outline: none;
  border-color: var(--brand-coral);
  box-shadow: 0 0 0 3px rgba(255, 84, 56, 0.15);
}

.lx-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--lx-text-secondary);
  margin-bottom: 0.5rem;
}

.lx-field { margin-bottom: 1rem; }

.lx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 48px;
}

.lx-btn--gold,
.lx-btn--primary {
  background: var(--lx-gradient-accent);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(255, 84, 56, 0.28);
}

.lx-btn--gold:hover:not(:disabled),
.lx-btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 84, 56, 0.35);
}

.lx-btn--ghost {
  background: var(--lx-surface);
  border: 1px solid var(--lx-border);
  color: var(--lx-text);
}

.lx-btn--ghost:hover:not(:disabled) {
  border-color: var(--brand-coral);
  color: var(--brand-coral);
}

.lx-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.lx-card {
  background: var(--lx-card);
  border: 1px solid var(--lx-border);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--lx-shadow-md);
}

.lx-icon {
  display: inline-flex;
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.2em;
  flex-shrink: 0;
}

.lx-icon svg { width: 100%; height: 100%; }

.lx-toast-wrap {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  width: min(90vw, 420px);
}

.lx-toast {
  padding: 0.875rem 1.25rem;
  border-radius: 10px;
  background: var(--lx-surface);
  border: 1px solid var(--lx-border);
  color: var(--lx-text);
  font-size: 0.9375rem;
  box-shadow: var(--lx-shadow-lg);
  animation: lxToastIn 0.3s ease;
}

.lx-toast--dev {
  border-color: rgba(255, 84, 56, 0.4);
  color: var(--brand-coral-dark);
  background: #fff8f6;
}

.lx-toast--error {
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--lx-danger);
  background: #fef2f2;
}

@keyframes lxToastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.lx-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 84, 56, 0.2);
  border-top-color: var(--brand-coral);
  border-radius: 50%;
  animation: lxSpin 0.7s linear infinite;
}

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

.lx-progress {
  height: 8px;
  background: var(--brand-navy-muted);
  border-radius: 99px;
  overflow: hidden;
}

.lx-progress__bar {
  height: 100%;
  background: var(--lx-gradient-accent);
  transition: width 0.3s;
}

.lx-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--brand-coral);
}

.lx-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--lx-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 0.75rem;
  background: var(--lx-surface);
}

.lx-option:hover {
  border-color: rgba(255, 84, 56, 0.4);
  background: #fffaf9;
}

.lx-option.is-selected {
  border-color: var(--brand-coral);
  background: var(--brand-coral-muted);
}

.lx-option input {
  margin-top: 0.25rem;
  accent-color: var(--brand-coral);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.lx-question-body {
  line-height: 1.85;
  margin-bottom: 1.5rem;
  color: var(--lx-text);
}

.lx-question-body img { max-width: 100%; border-radius: 8px; }

.lx-step-head {
  text-align: center;
  margin-bottom: 2rem;
}

.lx-step-head__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-coral-muted);
  border: 1px solid rgba(255, 84, 56, 0.2);
  border-radius: 50%;
  color: var(--brand-coral);
}

.lx-step-head__icon svg { width: 28px; height: 28px; }

.lx-step-head__title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--lx-text);
}

.lx-step-head__desc {
  color: var(--lx-muted);
  line-height: 1.8;
  max-width: 520px;
  margin: 0 auto;
}

.lx-layout {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(19, 34, 77, 0.05), transparent 60%),
    radial-gradient(ellipse 60% 40% at 10% 80%, rgba(255, 84, 56, 0.04), transparent 50%),
    var(--lx-bg);
  padding: 2rem 1rem 4rem;
}

.lx-layout__inner {
  max-width: 560px;
  margin: 0 auto;
}

.lx-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--lx-muted);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  min-height: 44px;
}

.lx-back:hover { color: var(--brand-coral); }

.lx-result-pass { color: var(--lx-success); }
.lx-result-fail { color: var(--lx-danger); }

.lx-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--brand-coral);
  margin: 1rem 0;
}

.lx-payment-method {
  padding: 1rem;
  border: 1px solid var(--lx-border);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  cursor: pointer;
  background: var(--lx-surface);
  transition: all 0.2s;
}

.lx-payment-method:hover {
  border-color: rgba(255, 84, 56, 0.35);
}

.lx-payment-method.is-selected {
  border-color: var(--brand-coral);
  background: var(--brand-coral-muted);
}

.lx-payment-details {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--lx-border);
  font-size: 0.875rem;
  color: var(--lx-text-secondary);
}

.lx-payment-details__dest {
  font-weight: 800;
  font-size: 1rem;
  color: var(--lx-text);
  letter-spacing: 0.02em;
  word-break: break-all;
  margin-bottom: 0.5rem;
  unicode-bidi: plaintext;
}

.lx-payment-details__desc {
  margin: 0;
  line-height: 1.7;
  white-space: pre-wrap;
}

.lx-error-text {
  color: var(--lx-danger);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.lx-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--brand-navy-muted);
  border: 1px solid var(--lx-border);
  border-radius: 999px;
  font-weight: 700;
  color: var(--brand-navy);
}

.lx-score-item {
  text-align: center;
  padding: 1rem;
  background: var(--lx-bg2);
  border-radius: 10px;
  border: 1px solid var(--lx-border);
}

.lx-score-item__val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand-coral);
}

.lx-score-item__label {
  font-size: 0.8125rem;
  color: var(--lx-muted);
}

.lx-score-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.lx-exam-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.lx-exam-meta { font-size: 0.875rem; color: var(--lx-muted); }

.lx-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.lx-actions .lx-btn { flex: 1; min-width: 120px; }

.lx-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 480px) {
  .lx-card { padding: 1.25rem; }
}
