/* Student pages: account portal, the six-page survey and the printable summary. */

.container { max-width: 1180px; margin: 28px auto; padding: 0 20px; }

/* ---------- account portal (register / login) ---------- */
.portal { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.portal.single { grid-template-columns: minmax(0, 520px); justify-content: center; }
.portal-form .switch-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.portal-form .switch-line h2 { margin: 0; font-size: 1.3rem; }
.portal-form .form-stack { display: grid; gap: 18px; }
.portal-aside { position: sticky; top: 20px; background: var(--forest); color: #EDE6D3; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.portal-aside h2 { color: var(--golden-wheat); font-size: 1.1rem; }
.portal-aside h3 { color: var(--white); font-size: 1rem; margin-top: 18px; }
.portal-aside ul { margin: 0; padding-inline-start: 20px; }
.portal-aside li { margin-bottom: 4px; }
.steps { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 12px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--golden-wheat); color: var(--forest); font-weight: 700; }
.steps b { color: var(--white); display: block; }
.privacy-note { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .18); font-size: .88rem; color: #D8CFB8; }

.password-rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; font-size: .86rem; color: var(--text-soft); }
.password-rules li::before { content: "○"; margin-inline-end: 6px; }
.password-rules li.ok { color: var(--success); }
.password-rules li.ok::before { content: "✓"; }
.strength { height: 6px; border-radius: 6px; background: var(--surface-sunken); overflow: hidden; margin-top: 8px; }
.strength span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s, background .2s; }
.strength[data-level="2"] span { background: var(--golden-wheat); }
.strength[data-level="3"] span, .strength[data-level="4"] span { background: var(--success); }
/* Consent: after the passwords match, the checkbox is focused and glows until ticked. */
.consent-box { border-radius: var(--radius-sm); padding: 10px 12px; border: 2px solid transparent; transition: border-color .2s, box-shadow .2s; }
.consent-box.attention { border-color: #1FA971; box-shadow: 0 0 0 4px rgba(31, 169, 113, .25); animation: consent-glow 1.4s ease-in-out infinite; }
.consent-box.attention input[type="checkbox"] { outline: 3px solid #1FA971; outline-offset: 2px; }
.consent-box.done { border-color: transparent; }
@keyframes consent-glow { 50% { box-shadow: 0 0 0 8px rgba(31, 169, 113, .12); } }
@media (prefers-reduced-motion: reduce) { .consent-box.attention { animation: none; } }
.counter { float: left; font-size: .8rem; color: var(--text-soft); direction: ltr; }
.success-panel { text-align: center; padding: 10px 0; }
.success-panel .check-mark { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); font-size: 2rem; }
.record-number { display: inline-flex; align-items: center; gap: 10px; margin: 12px 0 18px; padding: 10px 18px; border: 2px dashed var(--golden-wheat); border-radius: var(--radius-sm); font-size: 1.4rem; font-weight: 700; letter-spacing: .5px; color: var(--heading); direction: ltr; font-family: 'Segoe UI', Tahoma, Arial, sans-serif; }
.success-panel .dialog-actions { justify-content: center; }
.success-panel .alert { text-align: right; display: block; }
.codes { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 24px; }
.codes p { margin: 0; }
.codes .record-number { margin: 6px 0 14px; }
.record-number.recovery { border-color: var(--damask-red); color: var(--danger); letter-spacing: 2px; }

/* ---------- password recovery ---------- */
.stepper { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 18px; counter-reset: step; flex-wrap: wrap; }
.stepper li { flex: 1 1 120px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--text-soft); font-size: .9rem; counter-increment: step; }
.stepper li::before { content: counter(step); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid currentColor; font-weight: 700; flex: 0 0 auto; }
.stepper li[aria-current="step"] { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.stepper li.done { color: var(--success); }
.stepper li.done::before { content: "✓"; background: var(--success-soft); }
.method-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border: 0; padding: 0; margin: 0; }
.method-choice legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.method-choice label { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; }
.method-choice label small { font-weight: 400; color: var(--text-soft); font-size: .8rem; }
.method-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.method-choice label:has(input:checked) { border-color: var(--primary); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--golden-wheat); }
.method-choice label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 760px) { .method-choice { grid-template-columns: 1fr; } }

/* ---------- live survey status ---------- */
.survey-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.survey-status .countdown { font-size: .9rem; color: var(--text-soft); }
.survey-status.open .countdown { color: var(--success); font-weight: 600; }
.survey-status.urgent .countdown { color: var(--danger); }
.status-banner { background: var(--surface); border: 1px solid var(--line); border-inline-start: 5px solid var(--golden-wheat); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }

/* ---------- survey ---------- */
.survey-top { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-inline-start: 5px solid var(--golden-wheat); border-radius: var(--radius); padding: 12px 18px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.survey-top .who { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.survey-top .who b { color: var(--heading); }
.survey-top .links { display: flex; gap: 8px; flex-wrap: wrap; }
.survey-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; align-items: start; }
.survey-sidebar { position: sticky; top: 16px; background: var(--forest); color: #EDE6D3; border-radius: var(--radius); padding: 16px 12px; box-shadow: var(--shadow); }
.survey-sidebar h2 { font-size: 1rem; color: var(--golden-wheat); margin: 0 8px 4px; }
.progress-label { font-size: .85rem; margin: 0 8px; color: #D8CFB8; }
.progress { height: 8px; background: rgba(255, 255, 255, .15); border-radius: 8px; overflow: hidden; margin: 8px 8px 12px; }
.progress span { display: block; height: 100%; width: 0; background: var(--golden-wheat); transition: width .3s; }
.survey-nav { display: grid; gap: 3px; }
.nav-item { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: center; width: 100%; border: 0; background: transparent; color: #EDE6D3; padding: 9px 8px; text-align: right; border-radius: var(--radius-sm); font: 500 .95rem var(--font); cursor: pointer; text-decoration: none; line-height: 1.45; }
.nav-item .state { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .45); font-size: .8rem; font-weight: 700; }
.nav-item:hover:not(:disabled) { background: rgba(255, 255, 255, .08); color: var(--white); }
.nav-item[aria-current="step"] { background: var(--golden-wheat); color: var(--forest); font-weight: 700; }
.nav-item[aria-current="step"] .state { border-color: var(--forest); }
.nav-item.done .state { background: #1FA971; border-color: #1FA971; color: var(--white); }
.nav-item.stale .state { background: var(--golden-wheat); border-color: var(--golden-wheat); color: var(--forest); }
.nav-item:disabled { opacity: .5; cursor: not-allowed; }
.nav-divider { height: 1px; background: rgba(255, 255, 255, .15); margin: 8px 6px; }

.panel { display: none; }
.panel.active { display: block; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 20px; }
.panel-head .step-no { color: var(--text-soft); font-size: .9rem; margin: 0; }
.panel-head h2 { margin: 0; font-size: 1.35rem; }
.panel-head .saved { margin-top: 6px; }
.panel-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.panel-actions .button.primary { min-width: 240px; }
.subsection { grid-column: 1 / -1; margin: 6px 0 -4px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 1.02rem; color: var(--heading); }
.conditional { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 18px; padding: 16px; border-radius: var(--radius-sm); background: var(--surface-soft); border: 1px solid var(--line); }
.info-strip { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--line); }
.info-strip b { color: var(--heading); }

/* ---------- combobox ---------- */
.combo { position: relative; }
.combo input { padding-inline-end: 38px; }
.combo-toggle { position: absolute; top: 0; left: 0; height: 44px; width: 36px; border: 0; background: transparent; color: var(--text-soft); cursor: pointer; font-size: 1rem; }
.combo-toggle:disabled { cursor: not-allowed; opacity: .5; }
.combo-list { position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 4px); max-height: 300px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.combo-list [role="option"] { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.combo-list [role="option"] small { color: var(--text-soft); font-size: .8rem; }
.combo-list [role="option"][aria-selected="true"], .combo-list [role="option"]:hover { background: var(--accent-soft); }
.combo-list .combo-add { color: var(--info); font-weight: 600; border-top: 1px solid var(--line); }
.combo-note { padding: 8px 10px; color: var(--text-soft); font-size: .85rem; background: var(--surface-soft); border-radius: 6px; margin-bottom: 2px; }
.combo-badge { font-style: normal; font-size: .72rem; padding: 0 7px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); }
.combo-tag { display: inline-block; margin-top: 5px; font-size: .8rem; color: var(--warning); }

/* ---------- academic history ---------- */
.history-table { width: 100%; border-collapse: collapse; }
.history-table th { text-align: right; font-size: .88rem; color: var(--text-soft); font-weight: 600; padding: 0 6px 6px; }
.history-table td { padding: 4px 6px; vertical-align: top; }
.history-table td:last-child { width: 1%; }
.history-empty { color: var(--text-soft); font-size: .9rem; padding: 8px 6px; }

/* ---------- printable summary ---------- */
.summary-sheet { max-width: 900px; margin: 0 auto; }
.summary-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table th, .summary-table td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.summary-table th { width: 38%; color: var(--text-soft); font-weight: 600; }
.summary-table td.ltr { text-align: right; }
.summary-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }

@media (max-width: 960px) {
  .portal { grid-template-columns: 1fr; }
  .portal-aside { position: static; order: 2; }
  .survey-layout { grid-template-columns: 1fr; }
  .survey-sidebar { position: static; padding: 10px; }
  .survey-nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 4px; }
  .nav-divider { display: none; }
  .nav-item { white-space: nowrap; }
}
@media (max-width: 760px) {
  .container { padding: 0 16px; margin-top: 18px; }
  .conditional { grid-template-columns: 1fr; padding: 12px; }
  .conditional .field { grid-column: 1 / -1; }
  .panel-actions .button { width: 100%; }
  .password-rules { grid-template-columns: 1fr; }
}
@media print {
  .summary-page .survey-layout { display: block; }
  .summary-sheet { max-width: none; }
  .summary-table th, .summary-table td { padding: 5px 8px; border-color: #bbb; }
  .summary-top { display: flex !important; width: 100%; margin: 0 0 12px; padding: 7px 12px; color: #000; background: #fff; border: 1px solid #000; border-radius: 0; box-shadow: none; }
}
