@import url("https://fonts.googleapis.com/css2?family=Changa:wght@500;700;800&family=Source+Sans+3:wght@400;600;700&family=Space+Grotesk:wght@400;500;700&family=Tajawal:wght@500;700;800&display=swap");

:root {
  --bg-soft: #f3f7fd;
  --bg-base: #dfe8f4;
  --panel: #ffffff;
  --panel-muted: #f6f9ff;
  --text: #13253a;
  --muted: #5f7188;
  --line: #d2dded;
  --line-strong: #afc1da;
  --primary: #0d477f;
  --primary-strong: #082d52;
  --teal: #0d8f95;
  --teal-soft: #e7fbfb;
  --sand: #c9964f;
  --sand-soft: #f8edda;
  --success: #19724c;
  --danger: #bf2a3d;
  --radius-xl: 26px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow-lg: 0 24px 56px rgba(16, 34, 56, 0.14);
  --shadow-md: 0 12px 32px rgba(16, 34, 56, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  position: relative;
  color: var(--text);
  font-family: "Source Sans 3", sans-serif;
  background:
    radial-gradient(920px 460px at 8% -12%, rgba(13, 143, 149, 0.15), transparent 64%),
    radial-gradient(820px 430px at 104% -10%, rgba(13, 71, 127, 0.16), transparent 66%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.17) 0,
      rgba(255, 255, 255, 0.17) 9px,
      rgba(255, 255, 255, 0) 9px,
      rgba(255, 255, 255, 0) 18px
    ),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg-base) 100%);
}

html[lang="ar"] body {
  font-family: "Tajawal", sans-serif;
}

.page-language,
.page-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 14px;
}

.bg-orb {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 999px;
}

.orb-a {
  width: 340px;
  height: 340px;
  top: -120px;
  left: -100px;
  background: radial-gradient(circle, rgba(13, 143, 149, 0.23) 0%, rgba(13, 143, 149, 0) 72%);
}

.orb-b {
  width: 430px;
  height: 430px;
  top: -150px;
  right: -150px;
  background: radial-gradient(circle, rgba(13, 71, 127, 0.22) 0%, rgba(13, 71, 127, 0) 69%);
}

.language-shell,
.form-shell {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  animation: rise-in 0.5s ease both;
}

.language-card,
.form-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #ffffff 0%, #fdfefe 100%);
  box-shadow: var(--shadow-lg);
}

.language-card::before,
.form-shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 9px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--teal) 45%, var(--sand) 100%);
}

.language-card::after,
.form-shell::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  top: -136px;
  right: -120px;
  border-radius: 999px;
  background: conic-gradient(from 120deg, rgba(13, 71, 127, 0.09), rgba(13, 143, 149, 0.09), rgba(201, 150, 79, 0.09));
}

.language-card {
  text-align: center;
  padding: 48px 24px 36px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  color: #3f628f;
  font-family: "Space Grotesk", sans-serif;
}

html[lang="ar"] .eyebrow {
  font-family: "Changa", sans-serif;
}

.language-card h1,
.form-header h1 {
  margin: 10px 0 0;
  font-size: clamp(32px, 3.6vw, 50px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-family: "Space Grotesk", sans-serif;
}

html[lang="ar"] .language-card h1,
html[lang="ar"] .form-header h1 {
  font-family: "Changa", sans-serif;
  letter-spacing: 0;
}

.language-card p,
.form-header p {
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 17px;
  max-width: 790px;
}

.language-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.lang-btn {
  position: relative;
  min-height: 98px;
  border: 1px solid #9fb4d4;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
  color: #10365d;
  font-size: clamp(24px, 2vw, 30px);
  font-weight: 800;
  font-family: inherit;
  display: inline-grid;
  place-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.lang-btn[data-lang="ar"] {
  background: linear-gradient(180deg, #ffffff 0%, #f2fbfb 100%);
}

.lang-btn::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(13, 71, 127, 0.4), rgba(13, 143, 149, 0.4));
  opacity: 0.35;
}

.lang-btn:hover,
.lang-btn:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 16px 26px rgba(13, 71, 127, 0.24);
  transform: translateY(-2px);
  outline: none;
}

.language-note {
  margin: 17px 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: #4a6689;
}

.form-shell {
  padding: 28px 24px 22px;
}

.form-header {
  margin-bottom: 4px;
  animation: fade-up 0.45s ease both;
}

.step-indicator {
  margin: 18px 0 22px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  animation: fade-up 0.45s ease 0.05s both;
}

.step-indicator li {
  flex: 1 1 136px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f0f6ff;
  color: #586c8b;
  display: inline-grid;
  place-items: center;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.step-indicator li.is-current {
  border-color: #5e89c0;
  background: linear-gradient(180deg, #d9e9ff 0%, #c7ddff 100%);
  color: #133b61;
  box-shadow: 0 9px 20px rgba(13, 71, 127, 0.14);
}

.step-indicator li.is-complete {
  border-color: #86cece;
  background: var(--teal-soft);
  color: #177372;
}

.step-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(180deg, #f9fbff 0%, #f4f8ff 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
  animation: fade-up 0.45s ease 0.1s both;
}

.step-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--teal) 100%);
}

[dir="rtl"] .step-panel::before {
  left: auto;
  right: 0;
  border-radius: 0 18px 18px 0;
}

.step-panel[hidden] {
  display: none;
}

.step-title {
  margin: 0 0 14px;
  color: #173c63;
  font-size: clamp(22px, 2.1vw, 32px);
  line-height: 1.15;
  font-family: "Space Grotesk", sans-serif;
}

html[lang="ar"] .step-title {
  font-family: "Changa", sans-serif;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.checkbox-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.req-mark {
  color: var(--danger);
  margin-inline-start: 3px;
}

.field input,
.field textarea,
.field select,
.readonly-value {
  width: 100%;
  min-height: 48px;
  border: 1px solid #bfd0e8;
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 11px 12px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.field input::placeholder,
.field textarea::placeholder {
  color: #8ba0c0;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: #5f8ec8;
  box-shadow: 0 0 0 3px rgba(95, 142, 200, 0.2);
}

.field-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.field.has-error input,
.field.has-error textarea,
.field.has-error select {
  border-color: #d85662;
  box-shadow: 0 0 0 2px rgba(216, 86, 98, 0.16);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--primary);
}

.readonly-value {
  display: flex;
  align-items: center;
  border-style: dashed;
  background: var(--sand-soft);
  color: #6f5229;
  font-weight: 700;
}

.repeatable-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 10px;
  gap: 12px;
}

.repeatable-head h3 {
  margin: 0;
  color: #1a456e;
  font-size: 17px;
  font-family: "Space Grotesk", sans-serif;
}

html[lang="ar"] .repeatable-head h3 {
  font-family: "Changa", sans-serif;
}

.repeatable-list {
  display: grid;
  gap: 10px;
}

.skill-row,
.exp-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 12px;
}

.skill-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.8fr auto;
  gap: 8px;
  align-items: end;
}

.exp-card {
  display: grid;
  gap: 10px;
}

.exp-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.exp-card-title {
  font-size: 13px;
  font-weight: 800;
}

.btn {
  display: inline-grid;
  place-items: center;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
  font-family: "Space Grotesk", sans-serif;
  border: 1px solid transparent;
  border-radius: 12px;
  min-height: 48px;
  min-width: 126px;
  padding: 0 18px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

html[lang="ar"] .btn {
  font-family: "Changa", sans-serif;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.btn-primary {
  color: #ffffff;
  border-color: #0a3b6e;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  filter: brightness(1.05);
}

.btn-ghost {
  color: #385a82;
  border-color: #bfd0e7;
  background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
}

.btn-remove {
  min-width: 0;
  padding-inline: 12px;
  font-size: 14px;
  border-color: #e6b7bd;
  color: #8f2a36;
  background: #fff4f5;
}

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

.form-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  animation: fade-up 0.45s ease 0.15s both;
}

.form-actions #btnBack {
  margin-inline-end: auto;
}

[dir="rtl"] .form-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .form-actions #btnBack {
  margin-inline-start: auto;
  margin-inline-end: 0;
}

.form-notice {
  min-height: 22px;
  margin: 13px 0 0;
  font-size: 14px;
  font-weight: 800;
}

.form-notice.is-success {
  color: var(--success);
}

.form-notice.is-error {
  color: var(--danger);
}

.honeypot-wrap {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

[dir="rtl"] .form-header,
[dir="rtl"] .step-title,
[dir="rtl"] .field,
[dir="rtl"] .repeatable-head,
[dir="rtl"] .exp-card-head {
  text-align: right;
}

[dir="rtl"] input[type="date"],
[dir="rtl"] input[type="month"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="email"],
[dir="rtl"] .numeric-friendly {
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
}

@media (max-width: 980px) {
  .page-language,
  .page-form {
    padding: 20px 12px;
  }

  .language-card,
  .form-shell {
    border-radius: 20px;
  }

  .language-card {
    padding: 36px 18px 30px;
  }

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

  .grid-two,
  .skill-row {
    grid-template-columns: 1fr;
  }

  .step-indicator li {
    flex: 1 1 calc(50% - 9px);
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .btn {
    flex: 1 1 140px;
  }
}

@media (max-width: 580px) {
  .form-shell {
    padding: 18px 14px 16px;
  }

  .step-indicator li {
    flex-basis: 100%;
  }

  .step-panel {
    padding: 14px;
  }

  .btn {
    font-size: 16px;
  }

  .field input,
  .field textarea,
  .field select,
  .readonly-value {
    font-size: 14px;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
