/* Research-based Foundry UX layer: clarity, accessibility, recovery and mobile ergonomics. */
:root{
  --foundry-red:#e91820;
  --foundry-red-dark:#b90f18;
  --foundry-ink:#09090a;
  --foundry-panel:#121214;
  --foundry-paper:#f3eee3;
  --foundry-text:#f7f3ed;
  --foundry-muted:#b7afa6;
  --foundry-line:rgba(255,255,255,.13);
  --foundry-focus:#ff5a61;
}
html{scroll-behavior:smooth;scroll-padding-top:110px}
body{line-height:1.55}
a,button,input,select,textarea{transition:border-color .18s ease,background-color .18s ease,color .18s ease,box-shadow .18s ease,transform .18s ease}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:3px solid var(--foundry-focus)!important;
  outline-offset:3px!important;
  box-shadow:0 0 0 2px #09090a!important;
}
button,.btn,.book,.course-card-action,.mobile-foundry-cta a{min-height:48px}
button:disabled{cursor:not-allowed;opacity:.48}
.optional{color:#8f8880;font-size:.76rem;font-weight:650}
.text-link{display:inline-flex;margin-top:12px;color:#fff;text-decoration:underline;text-underline-offset:4px}

/* A simple page-level journey. It remains visible in the page without stacking over focused controls. */
.foundry-journey{
  position:relative;
  z-index:5;
  width:min(760px,calc(100% - 28px));
  margin:18px auto 0;
  padding:6px;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;
  border:1px solid var(--foundry-line);
  border-radius:14px;
  background:#101012;
  box-shadow:0 16px 45px rgba(0,0,0,.2);
}
.foundry-journey a{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  min-height:48px;
  padding:8px 12px;
  border-radius:10px;
  color:var(--foundry-muted);
  font-size:.86rem;
  font-weight:850;
  text-align:center;
}
.foundry-journey a span{
  display:grid;
  place-items:center;
  width:25px;
  height:25px;
  flex:0 0 auto;
  border:1px solid var(--foundry-line);
  border-radius:999px;
  color:#ddd6ce;
  background:rgba(255,255,255,.05);
  font-size:.72rem;
}
.foundry-journey a:hover{color:#fff;background:rgba(255,255,255,.055)}
.foundry-journey a.active{color:#fff;background:linear-gradient(135deg,var(--foundry-red),var(--foundry-red-dark));box-shadow:0 10px 26px rgba(233,24,32,.22)}
.foundry-journey a.active span{border-color:rgba(255,255,255,.35);color:#fff;background:rgba(0,0,0,.14)}

/* Overview navigation and readiness. */
.journey-cards,.readiness-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:38px}
.journey-cards a,.readiness-grid article{
  position:relative;
  min-height:190px;
  padding:24px;
  border:1px solid rgba(0,0,0,.13);
  border-radius:16px;
  color:#111;
  background:rgba(255,255,255,.82);
  box-shadow:0 16px 42px rgba(0,0,0,.055);
}
.journey-cards a:hover{transform:translateY(-3px);border-color:rgba(233,24,32,.44)}
.journey-cards small,.readiness-grid small{display:block;margin-bottom:26px;color:var(--foundry-red);font-weight:950;letter-spacing:.1em;text-transform:uppercase}
.journey-cards strong,.readiness-grid h3{display:block;margin:0 0 8px;font-size:1.32rem}
.journey-cards p,.readiness-grid p{margin:0;color:#655e56}
.journey-arrow{position:absolute;right:20px;top:18px;font-size:1.4rem}
.department-grid a{display:block;color:inherit}
.department-grid article{height:100%}

/* Course discovery. */
.course-tools{
  position:relative;
  display:grid;
  grid-template-columns:minmax(220px,1fr) auto;
  gap:12px;
  align-items:center;
  margin:0 0 22px;
  padding:12px;
  border:1px solid var(--foundry-line);
  border-radius:16px;
  background:#111113;
  box-shadow:0 16px 45px rgba(0,0,0,.2);
}
.course-search-wrap{position:relative}
.course-search-wrap svg{position:absolute;left:15px;top:50%;width:18px;height:18px;transform:translateY(-50%);color:#8f8880;pointer-events:none}
#course-search{
  width:100%;
  min-height:48px;
  padding:10px 14px 10px 43px;
  border:1px solid var(--foundry-line);
  border-radius:11px;
  color:#fff;
  background:#09090a;
}
.course-filters{display:flex;gap:8px;overflow-x:auto;padding:2px;scrollbar-width:thin}
.course-filter{
  flex:0 0 auto;
  min-height:46px;
  padding:0 14px;
  border:1px solid var(--foundry-line);
  border-radius:10px;
  color:var(--foundry-muted);
  background:rgba(255,255,255,.035);
  font-size:.82rem;
  font-weight:850;
  cursor:pointer;
}
.course-filter.active,.course-filter:hover{color:#fff;border-color:rgba(233,24,32,.62);background:rgba(233,24,32,.14)}
.course-results{min-height:24px;margin:0 0 14px;color:#a9a198;font-size:.9rem;font-weight:750}
.course-grid article{scroll-margin-top:110px}
.course-grid article[hidden]{display:none}
.course-card-action{
  position:absolute;
  right:28px;
  bottom:28px;
  z-index:2;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 16px;
  border:1px solid rgba(233,24,32,.48);
  border-radius:10px;
  color:#fff;
  background:rgba(233,24,32,.14);
  font-size:.84rem;
  font-weight:900;
}
.course-card-action:hover{background:var(--foundry-red);transform:translateY(-1px)}
.course-output{right:158px!important}
.course-fit{display:flex;align-items:flex-start;gap:9px;margin:18px 0 0;padding:12px;border-radius:11px;background:rgba(255,255,255,.045);color:#d5cec6;font-size:.88rem}
.course-fit b{flex:0 0 auto;color:#fff}
.course-help-panel{display:grid;grid-template-columns:1fr auto;gap:24px;align-items:center;margin:0 0 38px;padding:24px;border:1px solid rgba(233,24,32,.35);border-radius:16px;background:linear-gradient(135deg,rgba(233,24,32,.14),rgba(255,255,255,.025))}
.course-help-panel h3{margin:0 0 6px;font-size:1.45rem}
.course-help-panel p{margin:0;color:var(--foundry-muted)}

/* Authentication and application. */
.application-shell{padding-top:42px}
.application-intro{max-width:900px}
.application-intro h1{max-width:850px;font-size:clamp(3rem,6.5vw,6.2rem);line-height:.92;text-wrap:balance}
.application-intro>p:not(.eyebrow){max-width:760px}
.application-trust{display:flex;flex-wrap:wrap;gap:9px;margin-top:22px}
.application-trust span{padding:8px 11px;border:1px solid var(--foundry-line);border-radius:999px;color:#d6cfc7;background:rgba(255,255,255,.04);font-size:.82rem;font-weight:800}
.auth-layout{grid-template-columns:minmax(280px,.72fr) minmax(0,1.28fr);gap:22px}
.auth-card,.application-card,.student-summary{border-color:var(--foundry-line);border-radius:18px;background:#111113;box-shadow:0 22px 70px rgba(0,0,0,.22)}
.auth-card,.student-summary{padding:24px}
.application-card{padding:28px}
.next-card ol{display:grid;gap:12px;margin:18px 0 0;padding-left:20px;color:var(--foundry-muted)}
.auth-tabs{padding:5px;border:1px solid var(--foundry-line);border-radius:12px;background:#09090a}
.auth-tabs button{min-height:46px;border:0;border-radius:9px}
.auth-tabs button.active{background:var(--foundry-red);box-shadow:0 8px 22px rgba(233,24,32,.22)}
.field{position:relative;gap:8px}
.field label,.choice-group legend{font-size:.9rem;font-weight:850}
.field input,.field select,.field textarea{
  width:100%;
  min-height:50px;
  border:1px solid rgba(255,255,255,.15);
  border-radius:11px;
  color:#fff;
  background:#09090a;
}
.field textarea{min-height:132px;resize:vertical}
.field input:hover,.field select:hover,.field textarea:hover{border-color:rgba(255,255,255,.27)}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--foundry-focus)}
.field small{color:#9f978e}
.choice-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.choice{
  min-height:68px;
  padding:13px;
  border:1px solid var(--foundry-line);
  border-radius:12px;
  background:#0b0b0c;
  cursor:pointer;
}
.choice:hover{border-color:rgba(233,24,32,.48);background:rgba(233,24,32,.055)}
.choice:has(input:checked){border-color:rgba(233,24,32,.72);background:rgba(233,24,32,.12);box-shadow:inset 0 0 0 1px rgba(233,24,32,.18)}
.choice input{width:20px;height:20px;min-height:auto;accent-color:var(--foundry-red)}
.choice span{display:block}
.choice span small{display:block;margin-top:3px;color:#a79f96;line-height:1.35}
.compact-choices{grid-template-columns:repeat(3,minmax(0,1fr))}
.compact-choices .choice{min-height:52px;align-items:center}
.locked-panel{padding:14px 4px}
.locked-panel h2{max-width:620px;font-size:clamp(2.2rem,4vw,4rem)}

.application-progress{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:22px}
.application-progress button{
  min-height:64px;
  padding:10px 11px;
  display:grid;
  grid-template-columns:31px 1fr;
  gap:9px;
  align-items:center;
  border:1px solid var(--foundry-line);
  border-radius:12px;
  color:#8f8880;
  background:#09090a;
  box-shadow:none;
  text-align:left;
}
.application-progress button:not(:disabled){cursor:pointer}
.application-progress button span{display:grid;place-items:center;width:31px;height:31px;border-radius:999px;background:rgba(255,255,255,.07);font-size:.76rem;font-weight:950}
.application-progress button strong{display:block;color:inherit;font-size:.82rem;line-height:1.15}
.application-progress button.active{color:#fff;border-color:rgba(233,24,32,.55);background:rgba(233,24,32,.11)}
.application-progress button.active span{background:var(--foundry-red)}
.application-progress button.complete{color:#d0c8c0}
.application-progress button.complete span{background:#256d43;color:#fff}

.application-help{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:22px;padding:13px 14px;border:1px solid var(--foundry-line);border-radius:12px;color:#b9b1a8;background:rgba(255,255,255,.035);font-size:.9rem}
.application-help a{flex:0 0 auto;color:#fff;text-decoration:underline;text-underline-offset:3px}
.form-step{display:none}
.form-step.active{display:block;animation:foundryStepIn .2s ease}
@keyframes foundryStepIn{from{opacity:.35;transform:translateY(7px)}to{opacity:1;transform:none}}
.form-step-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:22px;padding-bottom:18px;border-bottom:1px solid rgba(255,255,255,.1)}
.form-step-head h3{margin:0 0 5px;font-size:1.75rem}
.form-step-head p{margin:0;color:#9f978e}
.step-count{flex:0 0 auto;padding:7px 10px;border-radius:999px;color:#fff;background:rgba(233,24,32,.14);font-size:.76rem;font-weight:900}
.form-actions{display:flex;justify-content:space-between;gap:12px;margin-top:26px;padding-top:20px;border-top:1px solid rgba(255,255,255,.09)}
.form-actions button{min-width:150px}
.form-actions .step-back{background:rgba(255,255,255,.045);border-color:rgba(255,255,255,.16);box-shadow:none}
.form-actions .step-next{margin-left:auto}
.form-actions #application-submit{width:auto;min-width:240px;margin:0}

/* Errors are shown both at the top and beside the field. */
.error-summary{margin:0 0 22px;padding:20px;border:2px solid #ff4c55;border-radius:14px;background:rgba(143,0,8,.18)}
.error-summary h2{margin:0 0 4px;font-size:1.35rem}
.error-summary p{margin:0 0 10px;color:#ffd9dc}
.error-summary ul{display:grid;gap:7px;margin:0;padding-left:20px}
.error-summary a{color:#fff;text-decoration:underline;text-underline-offset:3px}
.field-error{margin:2px 0 0;color:#ff9da2!important;font-size:.84rem;font-weight:800}
.has-error input,.has-error select,.has-error textarea,.has-error.choice,.has-error .choice{border-color:#ff4c55!important}

/* Check answers before submission. */
.review-groups{display:grid;gap:14px}
.review-group{overflow:hidden;border:1px solid var(--foundry-line);border-radius:14px;background:#0b0b0c}
.review-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:15px 17px;border-bottom:1px solid var(--foundry-line);background:rgba(255,255,255,.035)}
.review-heading h4{margin:0;font-size:1rem}
.review-heading button{min-height:40px;padding:0 12px;border:1px solid var(--foundry-line);border-radius:9px;color:#fff;background:transparent;box-shadow:none;font-size:.82rem;font-weight:850}
.review-heading button:hover{border-color:rgba(233,24,32,.6);background:rgba(233,24,32,.1)}
.review-group dl{margin:0}
.review-row{display:grid;grid-template-columns:minmax(120px,.42fr) minmax(0,1fr);gap:18px;padding:13px 17px;border-bottom:1px solid rgba(255,255,255,.075)}
.review-row:last-child{border-bottom:0}
.review-row dt{color:#9f978e;font-weight:750}
.review-row dd{margin:0;color:#f3eee8;overflow-wrap:anywhere;white-space:pre-wrap}
.consent-choice{margin-top:18px;min-height:auto}
.submission-note{margin-top:14px;padding:15px;border-left:4px solid var(--foundry-red);border-radius:0 11px 11px 0;background:rgba(233,24,32,.075)}
.submission-note p{margin:4px 0 0;color:var(--foundry-muted)}

.success-panel{display:grid;justify-items:start;padding:20px 4px}
.success-mark{display:grid;place-items:center;width:58px;height:58px;margin-bottom:20px;border-radius:999px;color:#fff;background:#247045;font-size:1.8rem;font-weight:950}
.success-panel h2{max-width:650px;font-size:clamp(2.4rem,5vw,4.8rem)}
.success-panel p{max-width:680px;color:var(--foundry-muted)}
.form-status{font-weight:750}
.form-status.error{color:#ff9da2}
.form-status.success{color:#9de7b4}

.mobile-foundry-cta{display:none}

@media(max-width:980px){
  .journey-cards,.readiness-grid{grid-template-columns:1fr}
  .course-tools{grid-template-columns:1fr}
  .auth-layout{grid-template-columns:1fr}
  .auth-layout aside{display:grid;grid-template-columns:1fr 1fr;gap:16px}
  .student-summary{margin:0}
}

@media(max-width:700px){
  html{scroll-padding-top:78px}
  body.has-mobile-foundry-cta{padding-bottom:82px}
  .foundry-journey{width:calc(100% - 20px);margin-top:10px;border-radius:13px}
  .foundry-journey a{min-height:44px;padding:7px 4px;font-size:.76rem;gap:5px}
  .foundry-journey a span{width:23px;height:23px}
  .course-filters{margin:0 -2px;padding-bottom:4px}
  .course-help-panel{grid-template-columns:1fr}
  .course-help-panel .btn{width:100%}
  .course-grid article{padding-bottom:260px}
  .course-output{left:20px!important;right:20px!important;bottom:78px!important}
  .course-card-action{left:20px;right:20px;bottom:20px}
  .application-shell{width:min(100% - 20px,1120px);padding-top:30px}
  .application-intro h1{font-size:clamp(2.7rem,13vw,4.4rem)}
  .auth-layout aside{grid-template-columns:1fr}
  .application-card,.auth-card,.student-summary{padding:19px}
  .application-progress{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .application-progress button{min-height:54px;padding:8px;grid-template-columns:26px 1fr;gap:7px}
  .application-progress button span{width:26px;height:26px}
  .application-progress button strong{font-size:.75rem}
  .application-help{align-items:flex-start;flex-direction:column}
  .form-step-head{display:block}
  .step-count{display:inline-flex;margin-top:10px}
  .field-grid,.choice-grid,.compact-choices{grid-template-columns:1fr}
  .form-actions{position:relative;bottom:auto;padding:16px 0 0;background:transparent;border-radius:0;backdrop-filter:none}
  .form-actions button,.form-actions #application-submit{min-width:0;flex:1;padding:0 12px}
  .review-row{grid-template-columns:1fr;gap:3px}
  .mobile-foundry-cta{
    position:fixed;
    left:10px;
    right:10px;
    bottom:10px;
    z-index:40;
    display:grid;
    grid-template-columns:1fr auto;
    gap:10px;
    align-items:center;
    padding:10px 10px 10px 14px;
    border:1px solid var(--foundry-line);
    border-radius:14px;
    color:#fff;
    background:#101012;
    box-shadow:0 20px 70px rgba(0,0,0,.5);
  }
  .mobile-foundry-cta span{font-size:.82rem;font-weight:800}
  .mobile-foundry-cta a{padding:0 15px;border-radius:10px;background:var(--foundry-red);font-size:.84rem;font-weight:900;display:flex;align-items:center}
}

@media(hover:hover){.journey-cards a:hover,.course-card-action:hover,.btn:hover{will-change:transform}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*:before,*:after{transition:none!important;animation:none!important}}
