/* Foundry visual QA layer — shared by the public Foundry page and admissions flow. */
body.foundry-site,
body.simple-bg {
  --foundry-red: #f01818;
  --foundry-red-dark: #a90d17;
  --foundry-ink: #070707;
  --foundry-panel: rgba(18,18,20,.82);
  --foundry-line: rgba(255,255,255,.13);
  --foundry-muted: #aaa39a;
}

body.foundry-site::before,
body.simple-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 8%, rgba(240,24,24,.16), transparent 27rem),
    radial-gradient(circle at 90% 35%, rgba(255,255,255,.045), transparent 24rem);
}

.foundry-site .nav,
.simple-bg .nav {
  border-color: rgba(255,255,255,.14);
  background: rgba(8,8,9,.88);
  box-shadow: 0 22px 70px rgba(0,0,0,.42);
}

.foundry-site .brand img,
.simple-bg .brand img {
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 12px 28px rgba(0,0,0,.35);
}

.foundry-hero-copy h1 {
  text-wrap: balance;
}

.foundry-console {
  position: relative;
}

.foundry-console::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px rgba(255,255,255,.08);
}

.department-grid article,
.schedule-grid article,
.auth-card,
.application-card,
.student-summary {
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.department-grid article:hover,
.schedule-grid article:hover {
  transform: translateY(-3px);
}

.application-shell {
  padding-top: 72px;
}

.application-intro {
  position: relative;
  padding: 0 2px 10px;
}

.application-intro h1 {
  max-width: 900px;
  text-wrap: balance;
}

.application-intro > p:last-child {
  max-width: 720px;
}

.auth-layout > aside {
  display: grid;
  gap: 18px;
}

.auth-card,
.application-card,
.student-summary {
  border-color: var(--foundry-line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)),
    rgba(8,8,9,.76);
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
  backdrop-filter: blur(16px);
}

.auth-card h3 {
  margin-bottom: 18px;
  font-size: 1.55rem;
}

.auth-card p {
  color: #c0b9b1;
}

.auth-tabs {
  position: relative;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(0,0,0,.28);
}

.auth-tabs button {
  min-height: 46px;
  border: 0;
  border-radius: 9px;
  color: #bdb6ae;
  background: transparent;
  box-shadow: none;
}

.auth-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--foundry-red), #c71118);
  box-shadow: 0 10px 30px rgba(240,24,24,.22);
}

.field {
  gap: 8px;
}

.field label,
.choice-group legend {
  color: #f6f3ee;
  letter-spacing: -.01em;
}

.field input,
.field select,
.field textarea,
.password-wrap input {
  min-height: 54px;
  border-color: rgba(255,255,255,.12);
  border-radius: 11px;
  color: #fff;
  background: rgba(0,0,0,.34);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field textarea {
  min-height: 128px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.password-wrap input:focus {
  border-color: rgba(240,24,24,.78);
  background: rgba(8,8,9,.72);
  box-shadow: 0 0 0 4px rgba(240,24,24,.12);
}

.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px #111319 inset;
  transition: background-color 9999s ease-in-out 0s;
}

.choice {
  min-height: 58px;
  border-color: rgba(255,255,255,.11);
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  cursor: pointer;
}

.choice:has(input:checked) {
  border-color: rgba(240,24,24,.72);
  background: rgba(240,24,24,.1);
  box-shadow: inset 0 0 0 1px rgba(240,24,24,.08);
}

.choice input {
  accent-color: var(--foundry-red);
}

#auth-submit,
#application-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 4px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--foundry-red), #c71118);
  box-shadow: 0 16px 40px rgba(240,24,24,.2);
}

#auth-submit:hover,
#application-submit:hover {
  transform: translateY(-1px);
}

.form-status:not(:empty) {
  min-height: auto;
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(240,24,24,.32);
  border-radius: 10px;
  color: #ffc0c0;
  background: rgba(240,24,24,.08);
  font-weight: 720;
}

.form-status.success:not(:empty) {
  border-color: rgba(88,211,132,.32);
  color: #b7f3ca;
  background: rgba(88,211,132,.08);
}

#locked-message {
  min-height: 260px;
  display: grid;
  place-content: center;
  text-align: center;
}

#locked-message h2 {
  max-width: 560px;
  margin-inline: auto;
  font-size: clamp(2rem, 5vw, 3.8rem);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 58px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 42px;
  min-height: 42px;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  color: #c5beb6;
  background: rgba(255,255,255,.055);
  box-shadow: none;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.password-toggle .eye-closed,
.password-toggle.is-visible .eye-open {
  display: none;
}

.password-toggle.is-visible .eye-closed {
  display: block;
}

.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle.is-visible {
  color: #fff;
  border-color: rgba(240,24,24,.68);
  background: rgba(240,24,24,.12);
}

.student-summary strong {
  max-width: 66%;
  overflow-wrap: anywhere;
  text-align: right;
}

@media (max-width: 980px) {
  body.simple-bg .nav-wrap {
    position: relative;
  }

  .foundry-hero {
    min-height: auto;
    padding-top: 54px;
  }

  .foundry-console {
    max-width: 680px;
  }

  .application-shell {
    padding-top: 46px;
  }

  .application-intro {
    margin-bottom: 26px;
  }
}

@media (max-width: 620px) {
  .foundry-site .nav-wrap,
  .simple-bg .nav-wrap {
    padding: 10px 10px 0;
  }

  .foundry-site .nav,
  .simple-bg .nav {
    min-height: 62px;
    padding: 9px 10px;
    border-radius: 14px;
    flex-wrap: nowrap;
  }

  .foundry-site .brand,
  .simple-bg .brand {
    gap: 8px;
  }

  .foundry-site .brand img,
  .simple-bg .brand img {
    width: 38px;
    height: 38px;
  }

  .foundry-site .menu,
  .simple-bg .menu {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 10px;
  }

  .foundry-site .nav-links,
  .simple-bg .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    left: 10px;
    right: 10px;
    z-index: 30;
    width: auto;
    padding: 8px;
    border-radius: 12px;
    background: rgba(8,8,9,.97);
    box-shadow: 0 24px 70px rgba(0,0,0,.55);
  }

  .application-shell {
    width: min(100% - 22px, 1120px);
    padding: 34px 0 64px;
  }

  .application-intro h1 {
    margin-bottom: 16px;
    font-size: clamp(2.55rem, 12.5vw, 4rem);
    line-height: .94;
  }

  .application-intro > p:last-child {
    font-size: 1rem;
  }

  .auth-layout {
    gap: 14px;
  }

  .auth-card,
  .application-card,
  .student-summary {
    padding: 18px;
    border-radius: 15px;
  }

  .auth-tabs {
    margin-bottom: 20px;
  }

  .auth-tabs button {
    padding-inline: 10px;
    font-size: .92rem;
  }

  .field-grid,
  .choice-grid {
    gap: 11px;
  }

  .foundry-hero,
  .foundry-dark,
  .dark-footer {
    width: min(100% - 22px, 1180px);
  }

  .foundry-hero h1 {
    font-size: clamp(3rem, 14vw, 4.7rem);
  }

  .foundry-meta {
    display: grid;
  }

  .foundry-meta span {
    justify-content: center;
    text-align: center;
  }

  .department-grid,
  .schedule-grid {
    grid-template-columns: 1fr;
  }

  .department-grid article {
    min-height: 190px;
  }

  .foundry-cta {
    margin-top: 42px;
    padding: 22px;
  }

  .foundry-cta .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .department-grid article,
  .schedule-grid article,
  .auth-card,
  .application-card,
  .student-summary,
  #auth-submit,
  #application-submit {
    transition: none;
  }
}
