@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

:root {
  --ap-navy: #061226;
  --ap-blue: #2f6fed;
  --ap-blue-deep: #1d4ed8;
  --ap-orange: #f08a24;
  --ap-text: #0f172a;
  --ap-muted: #64748b;
  --ap-card: #ffffff;
}

.apply-body {
  margin: 0;
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
  min-height: 100vh;
  color: #e8eef8;
  background: var(--ap-navy);
}

.apply-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.apply-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(160deg, #061226 0%, #0b2250 52%, #12338a 100%);
}

.apply-atmosphere-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.85;
}

.apply-atmosphere-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  animation: ap-orb 9s ease-in-out infinite alternate;
}

.apply-atmosphere-orb--blue {
  width: min(62vw, 560px);
  height: min(62vw, 560px);
  background: radial-gradient(circle, rgba(47, 109, 240, 0.55), transparent 70%);
  bottom: -18%;
  inset-inline-start: -12%;
}

.apply-atmosphere-orb--orange {
  width: min(48vw, 420px);
  height: min(48vw, 420px);
  background: radial-gradient(circle, rgba(255, 166, 77, 0.32), transparent 70%);
  top: -12%;
  inset-inline-end: -8%;
  animation-delay: -3s;
}

.apply-shell {
  position: relative;
  z-index: 1;
  width: min(880px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

/* ── Hero ── */
.apply-hero {
  margin-bottom: 1.25rem;
  padding: 0.25rem 0.15rem 0.5rem;
  animation: ap-rise 0.6s ease-out both;
}

.apply-hero-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.apply-logo-plate {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  flex: 0 0 auto;
}

.apply-logo-plate img {
  max-width: 86%;
  max-height: 86%;
  object-fit: contain;
}

.apply-logo-mark {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--ap-blue), var(--ap-blue-deep));
}

.apply-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9fc0ff;
}

.apply-kicker--dark {
  color: var(--ap-blue);
}

.apply-brand-title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(92deg, #ffffff 10%, #9fc0ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.apply-hero-line {
  margin: 0 0 0.45rem;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  font-weight: 700;
  color: #fff;
  max-width: 28rem;
  line-height: 1.45;
}

.apply-lead {
  margin: 0;
  max-width: 34rem;
  color: rgba(226, 232, 240, 0.82);
  line-height: 1.75;
  font-size: 0.98rem;
}

.apply-hero-actions {
  margin-top: 1rem;
}

.apply-back {
  display: inline-flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 700;
  font-size: 0.88rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.apply-back:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.apply-steps {
  list-style: none;
  margin: 1.35rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.apply-steps li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem 0.4rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.apply-steps span {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--ap-orange), #ffb347);
  color: #1a1208;
  font-size: 0.78rem;
  font-weight: 800;
}

/* ── Form cards ── */
.apply-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.apply-card {
  background: var(--ap-card);
  color: var(--ap-text);
  border-radius: 22px;
  padding: 1.25rem 1.3rem 1.4rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 22px 50px -28px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.apply-card--rise {
  animation: ap-rise 0.55s ease-out both;
  animation-delay: var(--d, 0s);
}

.apply-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.apply-card-head h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  color: #0b1f3a;
}

.apply-card-head p {
  margin: 0.2rem 0 0;
  color: var(--ap-muted);
  font-size: 0.88rem;
}

.apply-step-badge {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, var(--ap-blue), var(--ap-blue-deep));
  box-shadow: 0 10px 18px -12px rgba(29, 78, 216, 0.9);
  flex: 0 0 auto;
}

.apply-step-badge--orange {
  background: linear-gradient(145deg, var(--ap-orange), #ffb347);
  color: #1a1208;
  box-shadow: 0 10px 18px -12px rgba(240, 138, 36, 0.85);
}

.apply-count {
  margin-inline-start: auto;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #e8f0ff;
  color: var(--ap-blue);
  align-self: center;
}

.apply-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1rem;
}

.apply-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

.apply-field label {
  font-size: 0.86rem;
  font-weight: 700;
  color: #334155;
}

.apply-field input,
.apply-field select,
.apply-field textarea {
  width: 100%;
  border: 1px solid #d7e0ee;
  border-radius: 14px;
  padding: 0.78rem 0.9rem;
  background: #f4f7fc;
  font: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.apply-field input:focus,
.apply-field select:focus,
.apply-field textarea:focus {
  outline: none;
  border-color: var(--ap-blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.14);
}

.apply-field span.field-validation-error,
.apply-field .field-validation-valid + span,
.apply-field > span {
  color: #dc2626;
  font-size: 0.8rem;
}

.apply-needs {
  display: grid;
  gap: 0.7rem;
}

.apply-need {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1.5px solid #e2e8f0;
  background: linear-gradient(180deg, #fbfcfe, #f5f8fc);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.apply-need input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.apply-need-check {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.2rem;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  background: #fff;
  position: relative;
  flex: 0 0 auto;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.apply-need-check::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 3px;
  background: transparent;
  transform: scale(0.4);
  transition: transform 0.15s ease, background 0.15s ease;
}

.apply-need:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 111, 237, 0.35);
  box-shadow: 0 12px 24px -18px rgba(11, 31, 58, 0.4);
}

.apply-need.is-selected,
.apply-need:has(input:checked) {
  border-color: rgba(47, 111, 237, 0.55);
  background: linear-gradient(160deg, #eef4ff, #f8fbff);
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.1);
}

.apply-need.is-selected .apply-need-check,
.apply-need:has(input:checked) .apply-need-check {
  border-color: var(--ap-blue);
  background: var(--ap-blue);
}

.apply-need.is-selected .apply-need-check::after,
.apply-need:has(input:checked) .apply-need-check::after {
  background: #fff;
  transform: scale(1);
  clip-path: polygon(14% 44%, 0 65%, 40% 100%, 100% 20%, 80% 0, 38% 62%);
}

.apply-need-body {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.apply-need-body strong {
  font-size: 1.02rem;
  color: #0b1f3a;
}

.apply-need-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.apply-need-meta em {
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
}

.apply-need-jobs,
.apply-need-areas {
  font-size: 0.86rem;
  color: var(--ap-muted);
  line-height: 1.5;
}

.apply-docs {
  display: grid;
  gap: 0.75rem;
}

.apply-doc {
  display: grid;
  gap: 0.45rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: #f6f9fd;
  border: 1px dashed #c9d6e8;
}

.apply-doc-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.apply-doc-label strong {
  font-size: 0.92rem;
  color: #0b1f3a;
}

.apply-doc-label small {
  color: #94a3b8;
  font-weight: 600;
}

.apply-doc input[type="file"] {
  width: 100%;
  font: inherit;
}

.apply-empty-box {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: var(--ap-muted);
}

.apply-empty-box strong {
  display: block;
  color: #0b1f3a;
  margin-bottom: 0.25rem;
}

.apply-empty-box p {
  margin: 0;
  line-height: 1.6;
}

.apply-alert {
  background: #fee2e2;
  color: #991b1b;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  animation: ap-rise 0.35s ease-out both;
}

.apply-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.apply-actions-bar strong {
  display: block;
  color: #0b1f3a;
  font-size: 1.05rem;
}

.apply-actions-bar p {
  margin: 0.2rem 0 0;
  color: var(--ap-muted);
  font-size: 0.88rem;
}

.apply-actions-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.apply-submit {
  border: 0;
  border-radius: 14px;
  padding: 0.9rem 1.45rem;
  font: inherit;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--ap-blue), var(--ap-blue-deep));
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 16px 28px -16px rgba(29, 78, 216, 0.95);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.apply-submit:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.apply-link {
  color: var(--ap-blue);
  font-weight: 800;
  text-decoration: none;
}

.apply-link:hover {
  text-decoration: underline;
}

.apply-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.2rem;
  border-radius: 14px;
  font-weight: 800;
  text-decoration: none;
  color: #0b1f3a;
  background: #eef2f7;
  border: 1px solid #dbe3ef;
  transition: background 0.18s ease;
}

.apply-ghost:hover {
  background: #e4ebf5;
}

/* ── Success / Done ── */
.apply-page--done {
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.apply-done-stage {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  animation: ap-rise 0.65s ease-out both;
}

.apply-done-panel {
  text-align: center;
  background: rgba(255, 255, 255, 0.97);
  color: var(--ap-text);
  border-radius: 28px;
  padding: 2rem 1.5rem 1.75rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 30px 60px -28px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
}

.apply-done-ring {
  width: 96px;
  height: 96px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), transparent 45%),
    linear-gradient(145deg, #dcfce7, #bbf7d0);
  box-shadow: 0 16px 30px -18px rgba(22, 163, 74, 0.75);
  animation: ap-pop 0.55s 0.15s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.apply-done-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #16a34a;
  color: #fff;
}

.apply-done-circle {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 2;
}

.apply-done-check {
  stroke: #fff;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: ap-check 0.55s 0.45s ease-out forwards;
}

.apply-done-title {
  margin: 0.15rem 0 0.55rem;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0b1f3a;
  background: linear-gradient(92deg, #0b1f3a, #1d4ed8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.apply-done-message {
  margin: 0 auto;
  max-width: 26rem;
  color: #334155;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.7;
}

.apply-done-note {
  margin: 0.85rem auto 0;
  max-width: 26rem;
  color: var(--ap-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.apply-done-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1.4rem 0 1.5rem;
  text-align: center;
}

.apply-done-timeline div {
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.apply-done-timeline span {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: 0 0 0 4px #f1f5f9;
}

.apply-done-timeline .is-done {
  color: #15803d;
}

.apply-done-timeline .is-done span {
  background: #16a34a;
  box-shadow: 0 0 0 4px #dcfce7;
}

.apply-done-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.apply-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.apply-confetti i {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.85;
  animation: ap-fall 3.8s linear infinite;
}

.apply-confetti i:nth-child(1) { inset-inline-start: 12%; background: #2f6fed; animation-delay: 0s; }
.apply-confetti i:nth-child(2) { inset-inline-start: 28%; background: #f08a24; animation-delay: 0.4s; width: 6px; }
.apply-confetti i:nth-child(3) { inset-inline-start: 44%; background: #34d399; animation-delay: 0.8s; }
.apply-confetti i:nth-child(4) { inset-inline-start: 58%; background: #60a5fa; animation-delay: 1.1s; width: 10px; }
.apply-confetti i:nth-child(5) { inset-inline-start: 70%; background: #fbbf24; animation-delay: 0.2s; }
.apply-confetti i:nth-child(6) { inset-inline-start: 82%; background: #38bdf8; animation-delay: 1.4s; }
.apply-confetti i:nth-child(7) { inset-inline-start: 18%; background: #fb7185; animation-delay: 1.8s; width: 7px; }
.apply-confetti i:nth-child(8) { inset-inline-start: 90%; background: #2dd4bf; animation-delay: 0.6s; }

@keyframes ap-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes ap-orb {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4%, -3%, 0) scale(1.06); }
}

@keyframes ap-pop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes ap-check {
  to { stroke-dashoffset: 0; }
}

@keyframes ap-fall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(110vh) rotate(260deg); opacity: 0.2; }
}

@media (max-width: 720px) {
  .apply-grid {
    grid-template-columns: 1fr;
  }

  .apply-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .apply-actions-btns {
    flex-direction: column;
    align-items: stretch;
  }

  .apply-done-timeline {
    grid-template-columns: 1fr;
    text-align: start;
  }

  .apply-done-timeline div {
    flex-direction: row;
    justify-content: flex-start;
  }
}
