:root {
  color-scheme: light;
  --ink: #173243;
  --muted: #718189;
  --line: #e2eae5;
  --blue: #245f7b;
  --blue-soft: #eaf2f5;
  --green: #708b79;
  --green-soft: #edf3ee;
  --yellow: #e5bf58;
  --shadow: 0 15px 40px rgb(24 53 62 / 7%);
  font-family: Aptos, "Segoe UI Variable", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 0; }
body { min-height: 100vh; margin: 0; color: var(--ink); background: #f4f7f5; }
button, input, select, textarea { max-width: 100%; font: inherit; }
.topbar { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 max(20px, calc((100% - 1040px) / 2)); border-bottom: 1px solid var(--line); background: #fff; box-shadow: 0 4px 16px rgb(24 53 62 / 3%); }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.brand { display: flex; min-width: 0; align-items: center; gap: 10px; font-size: 15px; font-weight: 750; }
.brand-mark { display: block; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 10px; object-fit: contain; background: #fff; }
.brand-caption { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 450; }
.exit-button { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; color: #53617a; background: #fff; cursor: pointer; font-size: 12px; font-weight: 650; }
.exit-button:hover { border-color: #cbd4e3; color: var(--blue); }
main { width: min(820px, calc(100% - 32px)); min-width: 0; margin: 38px auto 56px; }
h1 { margin: 0; font-size: clamp(24px, 5vw, 30px); letter-spacing: -.8px; }
.subtitle { margin: 7px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.panel { min-width: 0; padding: clamp(22px, 4vw, 30px); border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.panel-heading { margin-bottom: 20px; }
.panel-heading h2 { margin: 0; font-size: 15px; }
.panel-heading p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.field { display: grid; min-width: 0; gap: 7px; }
.field[hidden] { display: none; }
.field.full { grid-column: 1 / -1; }
.field label { color: #405d64; font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 45px; padding: 10px 12px; border: 1px solid #dbe5df; border-radius: 9px; outline: none; color: var(--ink); background: white; font-size: 13px; }
.field textarea { min-height: 100px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #82a893; box-shadow: 0 0 0 3px #edf3ee; }
.password-control { position: relative; }
.password-control input { padding-right: 82px; }
.password-toggle { position: absolute; top: 50%; right: 9px; transform: translateY(-50%); padding: 6px; border: 0; border-radius: 5px; color: var(--blue); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.password-toggle:hover { background: var(--blue-soft); }
.password-toggle:focus-visible { outline: 3px solid rgb(229 191 88 / 70%); outline-offset: 2px; }
.date-hint, .file-name { color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
.file-button { display: inline-flex; min-height: 43px; align-items: center; gap: 9px; width: fit-content; max-width: 100%; padding: 8px 13px; border: 1px solid #dbe5df; border-radius: 9px; color: #53676d; background: white; cursor: pointer; font-size: 12px; }
.file-button:hover, .file-button:focus-within { border-color: #82a893; color: var(--green); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 23px; }
.button { display: inline-flex; max-width: 100%; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 1px solid transparent; border-radius: 9px; color: #fff; background: var(--blue); box-shadow: 0 5px 12px rgb(36 95 123 / 15%); cursor: pointer; text-align: center; text-decoration: none; font-size: 12px; font-weight: 700; transition: background .15s, transform .15s; }
.button:hover { transform: translateY(-1px); background: #194b63; }
.message { display: none; margin-top: 16px; padding: 12px 14px; border-radius: 8px; font-size: 12px; line-height: 1.5; }
.message.show { display: block; }
.message.success { color: var(--green); background: #e9f7f1; }
.message.error { color: #a33838; background: #fff0ef; }
.success-screen[hidden] { display: none !important; }
body.submission-complete > .topbar,
body.submission-complete > main:not(.success-screen) { display: none !important; }
.success-screen {
  display: grid;
  width: min(940px, calc(100% - 32px));
  min-height: 100vh;
  align-content: center;
  justify-items: center;
  gap: 28px;
  margin: 0 auto;
  padding: 28px 16px;
  text-align: center;
}
.success-screen h1 { max-width: 900px; color: var(--blue); font-size: clamp(32px, 7vw, 58px); line-height: 1.15; letter-spacing: -1.4px; }
.success-screen .button { min-width: 150px; }
.eyebrow { margin: 0 0 9px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 1.2px; }
main.auth-main { width: min(460px, calc(100% - 32px)); margin: min(12vh, 105px) auto 60px; }
.auth-main h1 { font-size: 30px; letter-spacing: -1px; }
.auth-main .subtitle { margin-bottom: 23px; }
.auth-panel { padding: 27px; border-top: 3px solid var(--yellow); }
.auth-panel .form-actions { margin-top: 17px; }
.auth-panel .button { width: 100%; }
.login-topbar { min-height: 84px; }
.login-brand-mark { width: 68px; height: 68px; flex-basis: 68px; }
.button:focus-visible, .exit-button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgb(229 191 88 / 70%);
  outline-offset: 2px;
}
@media (max-width: 520px) {
  .topbar { min-height: 58px; padding: 0 12px; }
  .login-topbar { min-height: 68px; }
  .brand { gap: 7px; font-size: 12px; }
  .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .login-brand-mark { width: 54px; height: 54px; flex-basis: 54px; }
  .exit-button { min-height: 34px; padding: 0 9px; font-size: 11px; }
  main { margin-top: 25px; }
  main.auth-main { margin-top: 48px; }
  .form-grid { grid-template-columns: 1fr; gap: 15px; }
  .field.full { grid-column: auto; }
  .form-actions > .button { flex: 1 1 100%; }
}
@media (max-width: 360px) {
  .brand-caption { display: none; }
  .topbar { gap: 6px; }
  main { width: calc(100% - 24px); }
  .panel { padding: 16px; }
}
