:root {
  --ink: #092b35;
  --deep: #043541;
  --deep-2: #062530;
  --teal: #0d6670;
  --mint: #c8e3d3;
  --gold: #f2b441;
  --paper: #f6efe3;
  --cream: #fff9ed;
  --surface: #ffffff;
  --clay: #c95d42;
  --muted: #60727a;
  --line: rgba(9, 43, 53, .14);
  --shadow: 0 28px 70px rgba(6, 37, 48, .18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 4%, rgba(242, 180, 65, .2), transparent 25rem),
    linear-gradient(180deg, #fffdf7 0, var(--paper) 46rem);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.portal-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  margin: 0;
  padding: 14px max(24px, calc((100vw - 1180px) / 2));
  color: #fff;
  background: var(--deep-2);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  text-decoration: none;
}
.portal-brand img {
  display: block;
  width: 170px;
  height: auto;
  padding: 6px 10px;
  border-radius: 3px;
  background: rgba(255,255,255,.96);
}
.portal-brand span {
  max-width: 210px;
  color: rgba(255,255,255,.78);
  font-size: .74rem;
  font-weight: 850;
  line-height: 1.3;
}
.portal-home-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.08);
  font-size: .82rem;
  font-weight: 850;
  text-decoration: none;
}
.portal-home-link:hover,
.portal-home-link:focus-visible {
  border-color: var(--gold);
  background: rgba(255,255,255,.15);
  outline: none;
}

.portal-main {
  width: min(1180px, calc(100% - 40px));
  margin: 30px auto 72px;
}
.portal-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  min-height: 430px;
  color: #fff;
  background: var(--deep-2);
  box-shadow: var(--shadow);
}
.portal-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, rgba(6,37,48,.98) 0%, rgba(6,37,48,.9) 48%, rgba(6,37,48,.16) 100%);
}
.portal-hero-copy {
  position: relative;
  z-index: 2;
  align-self: end;
  padding: clamp(38px, 6vw, 76px);
}
.portal-kicker {
  margin: 0 0 13px;
  color: var(--gold);
  font-size: .76rem;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.portal-hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5.6rem);
  line-height: .9;
  letter-spacing: -.055em;
  text-transform: uppercase;
}
.portal-hero-copy > p:last-child {
  max-width: 620px;
  margin: 26px 0 0;
  color: rgba(255,255,255,.82);
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  line-height: 1.65;
}
.portal-hero-art {
  position: relative;
  z-index: -2;
  min-height: 300px;
  background: url("/Images/school/frontansicht-weit.jpg") center / cover no-repeat;
}
.portal-hero-art::before {
  content: "";
  position: absolute;
  right: clamp(24px, 5vw, 70px);
  bottom: -56px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 24px rgba(242,180,65,.14);
}

.portal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .72fr);
  gap: 26px;
  margin-top: 28px;
  align-items: start;
}
.portal-card {
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  box-shadow: 0 18px 48px rgba(6,37,48,.08);
}
.portal-card h2,
.form-card h2,
.application-guide h2 {
  margin: 0 0 20px;
  color: var(--deep);
  font-size: clamp(1.5rem, 2.7vw, 2.15rem);
  line-height: 1.05;
  letter-spacing: -.035em;
}
.portal-form-card {
  position: sticky;
  top: 24px;
  border-top: 7px solid var(--gold);
}
.portal-form-card > p { margin: 0 0 22px; }

.steps {
  counter-reset: application-step;
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  align-items: center;
  min-height: 100px;
  margin: 0;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.step .num {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--deep);
  background: var(--gold);
  box-shadow: 0 7px 18px rgba(242,180,65,.28);
  font-size: .9rem;
  font-weight: 950;
}
.step p { margin: 0; color: var(--muted); line-height: 1.55; }
.step strong { color: var(--ink); }

label {
  display: block;
  margin: 16px 0 7px;
  color: var(--deep);
  font-size: .88rem;
  font-weight: 850;
}
input, select, textarea {
  width: 100%;
  min-height: 50px;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(9,43,53,.25);
  border-radius: 0;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input::placeholder, textarea::placeholder { color: #84949a; }
input:hover, select:hover, textarea:hover { border-color: rgba(13,102,112,.58); }
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(13,102,112,.12);
}
input:disabled {
  color: var(--deep);
  background: #eef3ef;
  opacity: 1;
}
textarea { min-height: 108px; resize: vertical; }
input[type="checkbox"], input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--teal);
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  margin-top: 20px;
  padding: 12px 20px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: var(--teal);
  box-shadow: 0 9px 22px rgba(13,102,112,.2);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
button:hover, button:focus-visible, .btn:hover, .btn:focus-visible {
  background: var(--deep);
  transform: translateY(-1px);
  outline: none;
}
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.secondary { color: var(--deep); background: #fff; border: 1px solid var(--line); box-shadow: none; }

.muted { color: var(--muted); font-size: .9rem; line-height: 1.6; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { margin: 18px 0; padding: 15px 17px; border-left: 5px solid currentColor; font-weight: 750; line-height: 1.5; }
.err { color: #8b241b; background: #fff1ed; }
.ok { color: #155e43; background: #edf9f2; }
.portal-privacy-note {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.55;
}

.portal-form-main {
  width: min(1180px, calc(100% - 40px));
  margin: 30px auto 72px;
}
.portal-form-intro {
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
  padding: clamp(34px, 5vw, 62px);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(6,37,48,.98), rgba(4,53,65,.83)),
    url("/Images/school/frontansicht-weit.jpg") center 42% / cover;
  box-shadow: var(--shadow);
}
.portal-form-intro::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -85px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(242,180,65,.9);
}
.portal-form-intro h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(2.7rem, 6vw, 5rem);
  line-height: .92;
  letter-spacing: -.05em;
  text-transform: uppercase;
}
.portal-form-intro .chip {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-top: 20px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--deep);
  background: var(--mint);
  font-size: .84rem;
  font-weight: 850;
}
.application-shell {
  display: grid;
  grid-template-columns: minmax(250px, .36fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.application-guide {
  position: sticky;
  top: 24px;
  padding: 28px;
  color: #fff;
  background: var(--deep);
  box-shadow: 0 16px 40px rgba(6,37,48,.14);
}
.application-guide h2 { color: #fff; font-size: 1.55rem; }
.application-guide ol { display: grid; gap: 0; margin: 24px 0 0; padding: 0; list-style: none; }
.application-guide li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,.13);
  color: rgba(255,255,255,.78);
  font-size: .88rem;
  font-weight: 750;
}
.application-guide li span { color: var(--gold); font-size: .72rem; font-weight: 950; letter-spacing: .08em; }
.guide-note {
  margin-top: 22px;
  padding: 15px;
  color: var(--deep);
  background: var(--mint);
  font-size: .84rem;
  line-height: 1.55;
}
.form-card {
  counter-reset: form-section;
  margin: 0;
  padding: clamp(24px, 4vw, 46px);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 14px 42px rgba(6,37,48,.08);
}
.form-card > h2 {
  counter-increment: form-section;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 44px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}
.form-card > h2::before {
  content: counter(form-section, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--deep);
  background: var(--gold);
  font-size: .75rem;
  font-weight: 950;
}
.form-card > h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 5px 20px; }
.section, details {
  margin-top: 15px;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--cream);
}
summary { color: var(--deep); font-weight: 900; cursor: pointer; }
.checkrow { display: flex; gap: 11px; align-items: flex-start; margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
.checkrow label { margin: 0; }
.radiobox { grid-column: 1 / -1; margin-top: 12px; }
.radios { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 12px; }
.radios label { display: flex; gap: 9px; align-items: center; margin: 0; }
.hint { margin-top: 14px; padding: 14px 16px; border-left: 5px solid var(--gold); color: var(--muted); background: #fff; font-size: .86rem; line-height: 1.55; }
.pv-text p { margin: 0 0 12px; }
.pv-dl { display: grid; grid-template-columns: 170px 1fr; gap: 9px 16px; }
.pv-dl dt { font-weight: 850; }
.pv-dl dd { margin: 0; color: var(--muted); }
.danger { color: #a72f24; }

.success-main { width: min(900px, calc(100% - 40px)); margin: 30px auto 72px; }
.success-hero {
  padding: clamp(38px, 6vw, 68px);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(6,37,48,.98), rgba(13,102,112,.82)),
    url("/Images/school/frontansicht-weit.jpg") center / cover;
  box-shadow: var(--shadow);
}
.success-hero h1 { margin: 0; font-size: clamp(2.6rem, 6vw, 4.8rem); line-height: .94; letter-spacing: -.05em; text-transform: uppercase; }
.success-hero p { margin: 16px 0 0; color: rgba(255,255,255,.82); }
.success-card { margin-top: 24px; padding: clamp(26px, 4vw, 44px); background: #fff; box-shadow: 0 16px 42px rgba(6,37,48,.09); }
.code { display: inline-block; padding: 12px 15px; border: 2px dashed var(--teal); color: var(--deep); background: var(--cream); font-size: 1.35rem; font-weight: 950; letter-spacing: .1em; }
.warn { margin-top: 18px; padding: 17px; border-left: 5px solid var(--gold); color: #6d4214; background: #fff8e8; white-space: pre-line; }
.list { padding-left: 22px; line-height: 1.7; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.portal-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
  text-align: center;
}

@media (max-width: 900px) {
  .portal-layout, .application-shell { grid-template-columns: 1fr; }
  .portal-form-card, .application-guide { position: static; }
  .application-guide ol { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 20px; }
}
@media (max-width: 700px) {
  .portal-header { padding: 12px 16px; }
  .portal-brand img { width: 138px; }
  .portal-brand span { display: none; }
  .portal-home-link { min-height: 38px; padding: 7px 10px; font-size: .74rem; }
  .portal-main, .portal-form-main, .success-main { width: min(100% - 24px, 1180px); margin-top: 12px; }
  .portal-hero { grid-template-columns: 1fr; min-height: 510px; }
  .portal-hero::after { background: linear-gradient(180deg, rgba(6,37,48,.98) 0%, rgba(6,37,48,.8) 60%, rgba(6,37,48,.16) 100%); }
  .portal-hero-copy { align-self: start; padding: 34px 24px 18px; }
  .portal-hero-art { min-height: 230px; }
  .portal-card, .form-card { padding: 24px 20px; }
  .grid { grid-template-columns: 1fr; }
  .application-guide { padding: 24px 20px; }
  .application-guide ol { grid-template-columns: 1fr; }
  .application-guide li { padding: 12px 0; }
  .pv-dl { grid-template-columns: 1fr; }
  .pv-dl dt { margin-top: 8px; }
  .form-card > h2 { grid-template-columns: 36px 1fr; font-size: 1.45rem; }
  .form-card > h2::before { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
