:root {
  --bg: #FAF8F5;
  --card-bg: #FFFFFF;
  --ink: #1F2430;
  --ink-soft: #5A6072;
  --accent: #5B3FE0;
  --accent-soft: #EFEBFC;
  --accent-deep: #4429C0;
  --success: #1FA37A;
  --success-soft: #E6F6F1;
  --border: #E7E3DC;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(31, 36, 48, 0.04), 0 12px 32px rgba(31, 36, 48, 0.06);
  --font-display: 'Cairo', 'IBM Plex Sans Arabic', sans-serif;
  --font-body: 'IBM Plex Sans Arabic', 'Cairo', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(circle at 8% 0%, rgba(91, 63, 224, 0.06), transparent 45%),
    radial-gradient(circle at 100% 12%, rgba(31, 163, 122, 0.05), transparent 40%);
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* ---------------- Topbar ---------------- */
.topbar {
  text-align: center;
  margin-bottom: 36px;
}
.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
}
.topbar__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.topbar__subtitle {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}

/* ---------------- Layout ---------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.form {
  padding: 28px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* ---------------- Steps ---------------- */
.step__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.step__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

/* ---------------- Plan grid ---------------- */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 520px) {
  .plan-grid { grid-template-columns: 1fr; }
}

.plan-card {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 16px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  background: #fff;
}
.plan-card:hover { border-color: #c9bff0; }
.plan-card input { position: absolute; opacity: 0; pointer-events: none; }

.plan-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  margin: 0 0 4px;
}
.plan-card__desc {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}

.plan-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(91, 63, 224, 0.12);
}
.plan-card.is-selected::after {
  content: "✓";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------------- Duration row ---------------- */
.duration-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.duration-pill {
  flex: 1;
  min-width: 120px;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s ease;
  position: relative;
}
.duration-pill input { position: absolute; opacity: 0; pointer-events: none; }
.duration-pill:hover { border-color: #c9bff0; }
.duration-pill.is-selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* ---------------- Price card ---------------- */
.price-card {
  border-radius: var(--radius-md);
  padding: 20px 22px;
  background: var(--success-soft);
  border: 1.5px solid #bfe6d9;
  text-align: center;
  transition: all 0.2s ease;
}
.price-card--empty {
  background: #F4F1EA;
  border-color: var(--border);
}
.price-card__label {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}
.price-card__amount {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--success);
  margin: 4px 0;
  direction: ltr;
}
.price-card--empty .price-card__amount { color: #9a9484; }
.price-card__hint {
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------------- Domain choice ---------------- */
.domain-choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.radio-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
}
.radio-pill:hover { border-color: #c9bff0; }
.radio-pill input { accent-color: var(--accent); width: 18px; height: 18px; flex-shrink: 0; }
.radio-pill:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---------------- Payment grid ---------------- */
.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 520px) {
  .payment-grid { grid-template-columns: 1fr; }
}
.payment-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s ease;
  position: relative;
}
.payment-card input { position: absolute; opacity: 0; pointer-events: none; }
.payment-card:hover { border-color: #c9bff0; }
.payment-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.payment-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.payment-card.is-selected .payment-card__icon {
  background: var(--accent);
  color: #fff;
}

/* ---------------- Fields ---------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; }
}
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.field__optional {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 12px;
}
.field input,
.field textarea {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; }

/* ---------------- Submit ---------------- */
.submit-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s ease, transform 0.1s ease;
}
.submit-btn:hover { background: var(--accent-deep); }
.submit-btn:active { transform: scale(0.99); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.submit-btn__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-message {
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 14px;
  text-align: center;
}
.form-message--success {
  background: var(--success-soft);
  color: #146650;
  border: 1px solid #bfe6d9;
}
.form-message--error {
  background: #FDEEEE;
  color: #B3261E;
  border: 1px solid #F3C8C6;
}

/* ---------------- Sidebar ---------------- */
.sidebar {
  padding: 24px 22px;
  position: sticky;
  top: 28px;
}
.sidebar__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px;
}
.sidebar__steps {
  margin: 0 0 16px;
  padding-inline-start: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.sidebar__steps strong { color: var(--ink); }
.sidebar__note {
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--accent-deep);
  line-height: 1.6;
}

@media (max-width: 860px) {
  .sidebar { position: static; }
}

/* ---------------- Accessibility ---------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
