/* ==========================================================================
   SAIACS Admissions - login, registration, password reset
   ui/style.css   (mobile first)
   ========================================================================== */

:root {
  --navy: #1f2b52;
  --navy-dark: #16203d;
  --navy-line: #33406b;
  --gold: #c8a24a;
  --ink: #22262e;
  --body: #3f4553;
  --muted: #6a7181;
  --line: #d5d8df;
  --line-soft: #e6e8ec;
  --page-bg: #f4f4f1;
  --tint: #f8f8f6;
  --error: #9b2420;
  --radius: 3px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-wrap: break-word;
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: auto auto 1fr auto;
  background: var(--page-bg);
  color: var(--body);
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

@supports (min-height: 100dvh) {
  body {
    min-height: 100dvh;
  }
}

/* nothing may push the page wider than the screen */
body > * {
  min-width: 0;
}

img,
iframe {
  max-width: 100%;
  border: 0;
}

img {
  height: auto;
}

h1,
h2,
h3 {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  color: var(--navy);
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
}

p {
  margin: 0 0 14px;
}

a {
  color: #1b4f7a;
}

a:hover {
  color: #12395a;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 13px;
}

.wrap--narrow {
  max-width: 560px;
}

/* --------------------------------------------------------------- header --- */

.site-header {
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 74px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.site-logo {
  display: inline-block;
  line-height: 0;
}

.site-logo img {
  height: 50px;
  width: auto;
}

/* ------------------------------------------------------------ page head --- */

.page-head {
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
}

.page-head .wrap {
  padding-top: 20px;
  padding-bottom: 20px;
}

.page-head h1 {
  font-size: 23px;
  letter-spacing: -0.2px;
}

.page-head p {
  margin: 7px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 15.5px;
}

.page-head--staging {
  background: #7c1d1a;
  border-bottom-color: #7c1d1a;
}

.page-head--staging h1 {
  color: #fff;
}

.page-head--staging p {
  color: #f3d7d5;
}

/* --------------------------------------------------------------- layout --- */

.layout {
  display: grid;
  grid-template-columns: 100%;
  gap: 20px;
  align-items: start;
  padding-top: 22px;
  padding-bottom: 34px;
}

.layout > * {
  min-width: 0;
}

.panel {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  padding: 18px 14px 22px;
}

.panel > h2 {
  font-size: 20px;
  margin-bottom: 14px;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

.panel-intro {
  margin-top: -4px;
  color: var(--muted);
  font-size: 15px;
}

.panel--login {
  background: var(--tint);
}

/* ---------------------------------------------------------------- forms --- */

.form-section {
  min-width: 0;
  border: 0;
  margin: 0 0 20px;
  padding: 0;
}

.form-section:last-of-type {
  margin-bottom: 16px;
}

.form-section > legend {
  display: block;
  width: 100%;
  padding: 0 0 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
}

.field {
  min-width: 0;
  margin-bottom: 15px;
}

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.field .req {
  color: var(--error);
  font-weight: 400;
}

.hint {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* single column on phones; paired only when there is room for it */
.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 16px;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 46px;
  padding: 8px 11px;
  background: #fff;
  border: 1px solid #bfc4ce;
  border-radius: var(--radius);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px; /* keeps iOS from zooming on focus */
  line-height: 1.4;
}

select {
  padding-right: 34px;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath fill='%234a5162' d='M.7 0h9.6L5.5 6.6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input::placeholder {
  color: #8b91a0;
  opacity: 1;
}

input:hover,
select:hover {
  border-color: #9aa1af;
}

input:focus,
select:focus {
  outline: 0;
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(31, 43, 82, 0.15);
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

/* ------------------------------------------------------------- messages --- */

.notice {
  padding: 11px 13px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  background: #f4f6fb;
  color: var(--ink);
  font-size: 14.5px;
  overflow-wrap: break-word;
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice--ok {
  border-color: #c9dcc9;
  border-left-color: #2f6b3c;
  background: #f2f7f2;
  color: #1f4b28;
}

.notice--error {
  border-color: #e3c4c2;
  border-left-color: var(--error);
  background: #fbf1f0;
  color: #6f1c19;
}

.field-error {
  display: block;
  margin: 2px 0 0;
  color: var(--error);
  font-size: 14px;
  font-weight: 600;
}

.field-error:empty {
  display: none;
}

/* -------------------------------------------------------------- buttons --- */

.btn {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.btn:hover {
  background: var(--navy-dark);
  border-color: var(--navy-dark);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: default;
}

.form-actions {
  margin-top: 18px;
}

.form-foot {
  margin: 12px 0 0;
  font-size: 15px;
}

/* ------------------------------------------------------------ recaptcha --- */
/* the widget is a fixed 304px wide iframe, so it is scaled down on
   narrow screens and given matching layout height                          */

.captcha {
  max-width: 100%;
  margin-bottom: 4px;
  overflow: hidden;
}

.captcha .g-recaptcha {
  width: 304px;
  max-width: 100%;
}

/* the widget is scaled to the available width by fitCaptcha() in index.php;
   overflow:hidden above is the fallback if scripting is unavailable */

/* --------------------------------------------------------------- footer --- */

.site-footer {
  background: var(--navy);
  color: #ccd2e2;
  font-size: 15px;
}

.footer-main {
  display: grid;
  grid-template-columns: 100%;
  gap: 24px;
  padding-top: 28px;
  padding-bottom: 26px;
}

.footer-main > * {
  min-width: 0;
}

.footer-logo img {
  height: 58px;
  width: auto;
}

.footer-about {
  max-width: 46ch;
  margin: 14px 0 0;
  color: #b9c1d5;
}

.site-footer h2 {
  display: inline-block;
  color: #fff;
  font-size: 18px;
  padding-bottom: 6px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--gold);
}

.footer-contact {
  margin: 0;
}

.footer-contact dt {
  font-weight: 600;
  color: #fff;
}

.footer-contact dd {
  margin: 0 0 12px;
  color: #b9c1d5;
  overflow-wrap: break-word;
}

.footer-contact dd:last-child {
  margin-bottom: 0;
}

.footer-bar {
  border-top: 1px solid var(--navy-line);
}

.footer-bar .wrap {
  padding-top: 14px;
  padding-bottom: 14px;
  font-size: 13.5px;
  color: #9aa4bf;
}

/* ============================================================ breakpoints ==
   480  - roomier gutters on large phones
   620  - tablets: inline buttons, two footer columns
   860  - paired form fields
   980  - registration + sign in side by side
   ========================================================================== */

@media (min-width: 480px) {
  .wrap {
    padding: 0 20px;
  }

  .panel {
    padding: 22px 20px 26px;
  }

  .page-head h1 {
    font-size: 26px;
  }
}

@media (min-width: 620px) {
  .wrap {
    padding: 0 26px;
  }

  .panel {
    padding: 26px 26px 30px;
  }

  .page-head .wrap {
    padding-top: 26px;
    padding-bottom: 24px;
  }

  .page-head h1 {
    font-size: 30px;
  }

  .layout {
    gap: 24px;
    padding-top: 28px;
    padding-bottom: 44px;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  select {
    height: 42px;
    font-size: 15.5px;
  }

  .btn {
    display: inline-block;
    width: auto;
    min-width: 190px;
    min-height: 0;
    font-size: 15px;
  }

  .footer-main {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 30px 40px;
    padding-top: 34px;
    padding-bottom: 30px;
  }

  .footer-logo img {
    height: 68px;
  }

  .site-header .wrap {
    min-height: 88px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .site-logo img {
    height: 62px;
  }
}

@media (min-width: 860px) {
  .field-row--2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .field-row--3 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (min-width: 980px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 30px;
    padding-top: 36px;
    padding-bottom: 60px;
  }

  .panel--register {
    grid-column: 1;
    grid-row: 1;
  }

  .panel--login {
    grid-column: 2;
    grid-row: 1;
  }

  .panel--login .btn {
    display: block;
    width: 100%;
  }

  /* single-panel pages (password reset) stay one column */
  .layout.wrap--narrow {
    grid-template-columns: minmax(0, 1fr);
  }
}
