/* The student portal (/account/): its own signed-in area, in the same colors as the registration desk and the admin.
   The login screens are one short form each: a title, the fields, one main button. */
@font-face{font-family:DM Sans;src:url('../fonts/dm-sans-variable.woff2') format('woff2');font-weight:100 1000;font-display:swap}
:root{
  font-family:DM Sans,system-ui,sans-serif;font-synthesis:none;color:var(--ink);background:var(--canvas);
  --brand:#c70600;--brand-dark:#9e0500;--stage:#260000;--action:#ff9806;--action-hover:#ffab33;
  --ink:#2a1512;--muted:#705b55;--border:#eadbd3;--field:#dccdc3;--canvas:#f9eee5;--panel:#fffaf5;--danger:#ab1730;
  --red-gradient:linear-gradient(155deg,#260000 0%,#610502 58%,#7c0202 100%);
}
*{box-sizing:border-box}
body{margin:0;min-height:100dvh;background:var(--canvas);font-size:1.0625rem;line-height:1.55}
[hidden]{display:none !important}
button,input{font:inherit}
button{cursor:pointer}
button:disabled{opacity:.6;cursor:default}
a{color:var(--brand-dark)}
h1,h2,h3,p{margin:0}
.skip-link{position:absolute;left:-999px;top:8px;z-index:20;padding:10px 16px;border-radius:8px;background:#fff;color:var(--ink)}
.skip-link:focus{left:8px}
.portal-loading{padding:48px 20px;text-align:center;color:var(--muted)}
.portal-hidden{position:absolute;width:1px;height:1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* Fields and buttons, shared by the login screens and the portal */
.portal-form{display:grid;gap:16px}
.portal-field{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:7px 12px}
.portal-field>label{grid-column:1;grid-row:1;font-size:.95rem;font-weight:600}
.portal-field>input,.portal-field>.portal-input{grid-column:1/-1;grid-row:2}
.portal-field>.portal-link{grid-column:2;grid-row:1}
.portal-field input{width:100%;height:52px;padding:0 15px;border:1.5px solid var(--field);border-radius:12px;background:#fff;color:var(--ink);font-size:1.05rem;transition:border-color .15s,box-shadow .15s}
.portal-field input:hover{border-color:#c4ada0}
.portal-field input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 4px #c7060024}
.portal-field input[readonly]{background:#f4ede8;color:var(--muted)}
.portal-input{position:relative}
.portal-input input{padding-right:76px}
.portal-show{position:absolute;top:7px;right:7px;height:38px;padding:0 12px;border:0;border-radius:9px;background:none;color:var(--muted);font-size:.9rem;font-weight:600}
.portal-show:hover{background:#f4ede8;color:var(--ink)}
.portal-field input[name="code"]{height:64px;padding:0 8px 0 calc(8px + .35em);font-size:1.8rem;font-weight:600;letter-spacing:.35em;text-align:center}
.portal-hint{margin-top:-8px;color:var(--muted);font-size:.9rem}
.portal-button{display:inline-flex;align-items:center;justify-content:center;min-height:52px;padding:0 24px;border:0;border-radius:12px;background:var(--action);color:#2a1512;font-size:1.05rem;font-weight:700;text-decoration:none;transition:background .15s,transform .05s}
.portal-button:hover:not(:disabled){background:var(--action-hover)}
.portal-button:active:not(:disabled){transform:translateY(1px)}
.portal-quiet{background:#fff;box-shadow:inset 0 0 0 1.5px var(--field);font-weight:600}
.portal-quiet:hover:not(:disabled){background:#faf3ee}
.portal-link{justify-self:start;padding:4px 0;border:0;background:none;color:var(--brand-dark);font-weight:600;text-align:left;text-decoration:none}
.portal-link:hover{text-decoration:underline;text-underline-offset:4px}
.portal-small{padding:0;font-size:.9rem}
.portal-center{justify-self:center;text-align:center}
.portal-danger{color:var(--danger)}
.portal-button:focus-visible,.portal-link:focus-visible,.portal-show:focus-visible,.portal-nav button:focus-visible,.portal-tile:focus-visible,.portal-help summary:focus-visible{outline:3px solid var(--brand-dark);outline-offset:2px}
.portal-message{padding:12px 14px;border-radius:12px;background:#fff4e0;font-size:.98rem;font-weight:600}
.portal-error{background:#fdecee;color:var(--danger)}

/* Signed out */
.portal-auth{min-height:100dvh;display:grid;justify-items:center;align-content:center;gap:26px;padding:32px 16px;background:var(--stage) var(--red-gradient)}
.portal-auth>img{width:170px;height:auto}
.portal-auth-card{width:min(400px,100%);padding:34px 30px 30px;border-radius:22px;background:#fff;box-shadow:0 30px 90px #00000059}
.portal-auth-card h1{font-size:1.65rem;line-height:1.2;letter-spacing:-.01em;text-align:center}
.portal-auth-card .portal-button{width:100%}
.portal-auth-card .portal-message{text-align:center}
.portal-lead{margin-top:-8px;color:var(--muted);font-size:1rem;text-align:center;overflow-wrap:anywhere}
.portal-or{display:flex;align-items:center;gap:14px;margin:6px 0 -2px;color:var(--muted);font-size:.92rem}
.portal-or::before,.portal-or::after{content:"";flex:1;height:1px;background:var(--border)}
.portal-help{color:var(--muted);font-size:.95rem;text-align:center}
.portal-help summary{display:inline-block;cursor:pointer;color:var(--brand-dark);font-weight:600;list-style:none}
.portal-help summary::-webkit-details-marker{display:none}
.portal-help p{margin:10px 0}
.portal-help-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 20px}
.portal-auth-back{color:#ffe1c2;font-size:.95rem;font-weight:600;text-decoration:none}
.portal-auth-back:hover{text-decoration:underline;text-underline-offset:4px}

/* Signed in: menu on the left on wide screens, a bar along the bottom on phones. */
.portal-app{min-height:100dvh;display:grid;grid-template-columns:260px minmax(0,1fr)}
.portal-side{position:sticky;top:0;height:100dvh;display:flex;flex-direction:column;gap:22px;padding:22px 18px;background:var(--stage) var(--red-gradient);color:#fff}
.portal-logo img{display:block;width:170px;height:auto}
.portal-nav{display:grid;gap:6px}
.portal-nav button{display:flex;align-items:center;min-height:50px;padding:10px 16px;border:0;border-radius:12px;background:none;color:#ffe9d6;font-weight:600;text-align:left}
.portal-nav button:hover{background:#ffffff1a}
.portal-nav button[aria-current="page"]{background:var(--brand);color:#fff}
.portal-nav .portal-nav-short{display:none}
.portal-who{margin-top:auto;display:grid;gap:10px;padding-top:16px;border-top:1px solid #ffffff33;font-size:.95rem;overflow-wrap:anywhere}
.portal-who .portal-button{min-height:46px}
#portal-main{padding:36px clamp(18px,4vw,48px) 64px;max-width:980px;width:100%}
#portal-main:focus{outline:none}
.portal-head{margin-bottom:24px}
.portal-head h1{font-size:2.1rem;line-height:1.12;letter-spacing:-.01em}
.portal-head p{margin-top:6px;color:var(--muted)}
#portal-main>.portal-message{margin-bottom:20px}
.portal-panel{margin-bottom:20px;padding:24px;border:1px solid var(--border);border-radius:18px;background:#fff}
.portal-panel h2{font-size:1.3rem;line-height:1.2;margin-bottom:12px}
.portal-panel h3{font-size:1.15rem;margin-bottom:4px}
.portal-panel p+p,.portal-panel p+.portal-button,.portal-panel p+.portal-form,.portal-panel .portal-form+.portal-link,.portal-panel .portal-form+.portal-note{margin-top:12px}
.portal-panel .portal-form .portal-button{justify-self:start}
.portal-offer{border:2px solid var(--action);background:#fff7ea}
/* A single short form inside the portal, such as changing the email: narrow, with a full-width button. */
.portal-narrow{max-width:440px}
.portal-panel.portal-narrow .portal-form .portal-button{justify-self:stretch}
.portal-head p{overflow-wrap:anywhere}
.portal-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;margin-bottom:22px}
.portal-tile{display:grid;gap:4px;padding:18px;border:1px solid var(--border);border-radius:16px;background:#fff;color:var(--ink);text-align:left;transition:border-color .15s,box-shadow .15s}
.portal-tile:hover{border-color:var(--brand);box-shadow:0 6px 20px #2600000f}
.portal-tile strong{font-size:1.1rem}
.portal-tile span{color:var(--muted);font-size:.95rem}
.portal-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:18px;align-items:start}
.portal-card{display:grid;justify-items:center;align-content:start;gap:4px;padding:22px 18px;border:1.5px solid var(--border);border-radius:18px;background:var(--panel);text-align:center}
.portal-card h3{font-size:1.3rem;line-height:1.2;overflow-wrap:anywhere}
.portal-card-package,.portal-note{color:var(--muted);font-size:.98rem}
.portal-card-left{font-size:1.2rem;font-weight:700}
.portal-card-due{font-weight:700;color:var(--danger)}
.portal-card svg{display:block;width:220px;height:220px;margin:10px auto 2px;padding:10px;border-radius:14px;background:#fff;shape-rendering:crispEdges}
.portal-history{width:100%;margin-top:10px;text-align:left}
.portal-history summary{cursor:pointer;font-weight:600;color:var(--brand-dark)}
.portal-history ul,.portal-list{margin:10px 0 0;padding:0;list-style:none}
.portal-history li,.portal-list li{padding:10px 0;border-top:1px solid var(--border);overflow-wrap:anywhere}
.portal-list li{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 18px}
.portal-list li:first-child{border-top:0;padding-top:0}
.portal-list strong{font-size:1.05rem}
.portal-list .portal-button{min-height:44px}
.portal-perks{margin:0;padding-left:22px}
.portal-perks li{margin-bottom:8px}
.portal-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 20px}
.portal-two{grid-template-columns:repeat(2,minmax(0,1fr))}
.portal-two .portal-wide{grid-column:1/-1}
.portal-check{display:flex;align-items:flex-start;gap:12px;font-weight:600}
.portal-check input{width:22px;height:22px;margin-top:3px;flex-shrink:0;accent-color:var(--brand)}

@media(max-width:860px){
  /* The top bar keeps its own height; a short screen leaves the room below the content, not inside the bar. */
  .portal-app{grid-template-columns:1fr;grid-template-rows:auto 1fr;padding-bottom:76px}
  .portal-side{position:static;height:auto;flex-direction:row;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px}
  .portal-logo img{width:110px}
  .portal-who{margin:0;padding:0;border:0;grid-auto-flow:column;align-items:center}
  #portal-email{display:none}
  .portal-who .portal-button{min-height:42px;padding:0 14px;font-size:.95rem}
  .portal-nav{position:fixed;left:0;right:0;bottom:0;z-index:10;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;padding:6px 6px calc(6px + env(safe-area-inset-bottom));background:var(--stage);box-shadow:0 -6px 24px #0004}
  .portal-nav button{justify-content:center;min-height:56px;padding:6px 2px;font-size:.86rem;text-align:center;border-radius:10px}
  .portal-nav .portal-nav-long{display:none}
  .portal-nav .portal-nav-short{display:inline}
  #portal-main{padding:24px 16px 40px}
  .portal-head h1{font-size:1.75rem}
  .portal-panel{padding:20px 16px}
  .portal-two{grid-template-columns:1fr}
  .portal-card svg{width:200px;height:200px}
}
@media(max-width:420px){
  .portal-auth-card{padding:28px 22px 24px}
}
