/* Academy apply page - /academy/apply */
.aap-page {
  --aap-brand: #328ce7;
  --aap-brand-deep: #1d5fad;
  --aap-navy: #0b2744;
  --aap-ink: #07111f;
  --aap-muted: #5b6b7c;
  --aap-line: rgba(15, 23, 42, 0.1);
  --aap-sky: #e8f3fc;
  --aap-mint: #d8f3ec;
  --aap-sand: #fff4df;
  --aap-lavender: #e8eefc;
  --aap-coral: #ffe8df;
  --aap-radius: 1.25rem;
}

.aap-page .aap-main {
  overflow: clip;
}

/* Hero - training illustration background */
.aap-hero {
  position: relative;
  color: #fff;
  background-color: #0b2744;
  background-image: url("../images/services/tech-training.webp");
  background-position: right center;
  background-size: cover;
  background-repeat: no-repeat;
  padding: clamp(6.5rem, 10vw, 8rem) 0 clamp(3.5rem, 6vw, 4.5rem);
  overflow: hidden;
}

.aap-hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      105deg,
      rgba(6, 21, 38, 0.94) 0%,
      rgba(11, 39, 68, 0.88) 38%,
      rgba(11, 39, 68, 0.55) 62%,
      rgba(20, 90, 158, 0.28) 100%
    ),
    linear-gradient(180deg, rgba(6, 21, 38, 0.35), rgba(6, 21, 38, 0.15) 40%, rgba(6, 21, 38, 0.45));
  pointer-events: none;
}

.aap-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 40rem;
}

.aap-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.aap-crumb a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

.aap-crumb a:hover {
  color: #fff;
}

.aap-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  animation: aap-rise 0.7s ease both;
}

.aap-brand__mark {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.75rem;
  background: linear-gradient(145deg, #57a6f0, #2176d9);
  box-shadow: 0 10px 28px rgba(33, 118, 217, 0.35);
}

.aap-hero h1,
.aap-hero #aap-heading {
  margin: 0 0 0.85rem;
  font-size: clamp(2rem, 5vw, 3.15rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #fff;
  -webkit-text-fill-color: #fff;
  background: none;
  animation: aap-rise 0.75s 0.08s ease both;
}

.aap-hero__lead {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
  animation: aap-rise 0.75s 0.16s ease both;
}

/* Form shell */
.aap-body {
  position: relative;
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(4rem, 7vw, 6rem);
  background:
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(50, 140, 231, 0.12), transparent 55%),
    radial-gradient(ellipse 45% 35% at 0% 30%, rgba(126, 211, 184, 0.16), transparent 50%),
    linear-gradient(180deg, #f4f8fc 0%, #eef5fb 48%, #f7fafc 100%);
}

.aap-body::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(50, 140, 231, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.aap-wrap {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1rem;
}

.aap-note {
  margin: 0 0 1.5rem;
  padding: 0.9rem 1.1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(50, 140, 231, 0.18);
  color: var(--aap-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.aap-note strong {
  color: var(--aap-navy);
}

/* Sections */
.aap-section {
  margin-bottom: 1.25rem;
  padding: 1.35rem 1.25rem 1.45rem;
  border-radius: var(--aap-radius);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 14px 36px rgba(11, 39, 68, 0.06);
  animation: aap-rise 0.65s ease both;
}

.aap-section:nth-child(1) { animation-delay: 0.05s; background: linear-gradient(160deg, #ffffff, var(--aap-sky)); }
.aap-section:nth-child(2) { animation-delay: 0.1s; background: linear-gradient(160deg, #ffffff, var(--aap-lavender)); }
.aap-section:nth-child(3) { animation-delay: 0.15s; background: linear-gradient(160deg, #ffffff, var(--aap-mint)); }
.aap-section:nth-child(4) { animation-delay: 0.2s; background: linear-gradient(160deg, #ffffff, var(--aap-sand)); }
.aap-section:nth-child(5) { animation-delay: 0.25s; background: linear-gradient(160deg, #ffffff, var(--aap-coral)); }
.aap-section:nth-child(6) { animation-delay: 0.3s; background: linear-gradient(160deg, #ffffff, #e6f0ff); }

.aap-section__head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.aap-section__num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, var(--aap-brand), var(--aap-brand-deep));
  box-shadow: 0 8px 18px rgba(50, 140, 231, 0.28);
}

.aap-section__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--aap-navy);
  letter-spacing: -0.02em;
}

.aap-section__hint {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--aap-muted);
  line-height: 1.45;
}

.aap-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .aap-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
}

.aap-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.aap-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--aap-navy);
}

.aap-help {
  font-size: 0.78rem;
  color: var(--aap-muted);
  line-height: 1.4;
}

.aap-page .aap-control,
.aap-page .form-control,
.aap-page .form-select {
  min-height: 3rem;
  padding: 0.7rem 0.95rem;
  border-radius: 0.85rem;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--aap-ink);
  font-size: 0.95rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.aap-page textarea.form-control {
  min-height: 7.5rem;
  resize: vertical;
}

.aap-page .aap-control:focus,
.aap-page .form-control:focus,
.aap-page .form-select:focus {
  border-color: var(--aap-brand);
  box-shadow: 0 0 0 4px rgba(50, 140, 231, 0.18);
  background: #fff;
  outline: none;
}

/* Passport upload */
.aap-upload {
  position: relative;
  display: grid;
  gap: 0.85rem;
}

.aap-upload__zone {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.15rem;
  border-radius: 1rem;
  border: 2px dashed rgba(50, 140, 231, 0.4);
  background: linear-gradient(160deg, rgba(50, 140, 231, 0.06), rgba(255, 255, 255, 0.85));
  transition: border-color 0.18s ease, background 0.18s ease;
}

.aap-upload__zone:hover {
  border-color: var(--aap-brand);
  background: linear-gradient(160deg, rgba(50, 140, 231, 0.1), #fff);
}

.aap-upload__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.9rem;
  background: linear-gradient(145deg, #57a6f0, #2176d9);
  color: #fff;
  font-size: 1.15rem;
}

.aap-upload__copy {
  flex: 1;
  min-width: 12rem;
}

.aap-upload__copy strong {
  display: block;
  color: var(--aap-navy);
  font-size: 0.95rem;
}

.aap-upload__copy span {
  color: var(--aap-muted);
  font-size: 0.82rem;
}

.aap-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.aap-upload #passport-preview {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.aap-upload #passport-preview[hidden] {
  display: none !important;
}

.aap-upload #passport-preview img {
  width: 112px;
  height: 140px;
  object-fit: cover;
  border-radius: 0.85rem;
  border: 2px solid rgba(50, 140, 231, 0.35);
  box-shadow: 0 10px 24px rgba(11, 39, 68, 0.12);
}

.aap-upload #passport-clear {
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #fff;
  color: var(--aap-navy);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
}

.aap-upload #passport-clear:hover {
  border-color: var(--aap-brand);
  color: var(--aap-brand-deep);
}

/* Submit */
.aap-actions {
  margin-top: 0.5rem;
  padding: 1.35rem 1.25rem;
  border-radius: var(--aap-radius);
  background: linear-gradient(145deg, #0b2744, #145a9e);
  box-shadow: 0 18px 40px rgba(11, 39, 68, 0.22);
  color: #fff;
}

.aap-actions__text {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
}

.aap-page #apply-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.15rem;
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #7eb6f5, #328ce7 45%, #2176d9);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 28px rgba(50, 140, 231, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.aap-page #apply-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(50, 140, 231, 0.5);
  filter: brightness(1.04);
}

.aap-page #apply-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.aap-page #apply-error,
.aap-page #apply-ok {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.85rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.aap-page #apply-error {
  background: rgba(254, 226, 226, 0.95);
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, 0.2);
}

.aap-page #apply-ok {
  background: rgba(209, 250, 229, 0.95);
  color: #047857;
  border: 1px solid rgba(4, 120, 87, 0.2);
}

.aap-page #apply-error[hidden],
.aap-page #apply-ok[hidden] {
  display: none !important;
}

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

@media (max-width: 767.98px) {
  .aap-hero {
    background-position: 70% center;
  }

  .aap-hero__shade {
    background: linear-gradient(
      180deg,
      rgba(6, 21, 38, 0.92) 0%,
      rgba(11, 39, 68, 0.88) 55%,
      rgba(11, 39, 68, 0.78) 100%
    );
  }
}

@media (prefers-reduced-motion: reduce) {
  .aap-brand,
  .aap-hero h1,
  .aap-hero__lead,
  .aap-section,
  .aap-page #apply-submit {
    animation: none !important;
    transition: none !important;
  }
}
