:root {
  color-scheme: light;
  --ink: #17263a;
  --muted: #66758a;
  --blue: #164d7a;
  --blue-dark: #0f3658;
  --blue-soft: #eaf3fa;
  --mint: #1d8a70;
  --mint-soft: #eaf8f4;
  --line: #d9e1e9;
  --paper: #ffffff;
  --canvas: #f3f6f9;
  --danger: #a83434;
  --danger-soft: #fff1f1;
  --warning: #805b10;
  --shadow: 0 18px 46px rgba(21, 47, 72, .11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); line-height: 1.5; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 42px 28px 28px;
}
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 17px; background: linear-gradient(145deg, var(--blue), #2e789f); color: white; font-weight: 800; letter-spacing: -.04em; box-shadow: 0 10px 24px rgba(22, 77, 122, .25); }
.eyebrow, .step-label { margin: 0 0 4px; color: var(--blue); font-size: .74rem; font-weight: 800; letter-spacing: .12em; }
h1 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -.035em; }
.subtitle { margin: 4px 0 0; color: var(--muted); }
.status-pill { display: flex; align-items: center; gap: 8px; border: 1px solid #b9dfd4; background: var(--mint-soft); color: #176b58; padding: 8px 13px; border-radius: 999px; font-size: .86rem; font-weight: 700; }
.status-pill span { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(29, 138, 112, .13); }

main { max-width: 1120px; margin: 0 auto; padding: 0 28px 48px; }
.security-note { display: flex; gap: 15px; align-items: center; padding: 18px 20px; border: 1px solid #b9d7e9; background: var(--blue-soft); border-radius: 16px; }
.security-note h2 { margin: 0 0 2px; font-size: 1rem; }
.security-note p { margin: 0; color: #425f78; }
.security-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--blue); color: white; }

.tabs { display: flex; gap: 6px; margin: 28px 0 0; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: transparent; color: var(--muted); padding: 13px 18px 14px; font-weight: 700; border-bottom: 3px solid transparent; }
.tab.active { color: var(--blue); border-color: var(--blue); }
.tab:focus-visible, .button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(35, 119, 166, .28); outline-offset: 2px; }

.panel { margin-top: 22px; padding: 30px; background: var(--paper); border: 1px solid #e0e6ec; border-radius: 22px; box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.panel h2 { margin: 0; font-size: 1.55rem; letter-spacing: -.025em; }
.privacy-label { margin: 0; max-width: 330px; color: var(--muted); text-align: right; font-size: .9rem; }

.form-grid, .open-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
label > span { display: block; margin-bottom: 7px; font-size: .88rem; font-weight: 700; }
label b { color: var(--danger); }
input, textarea { width: 100%; border: 1px solid #c9d3dc; border-radius: 10px; background: #fbfcfd; padding: 11px 12px; color: var(--ink); transition: border .15s, box-shadow .15s; }
input:hover, textarea:hover { border-color: #98adbf; }
input:focus, textarea:focus { border-color: #3a83ae; box-shadow: 0 0 0 3px rgba(58, 131, 174, .12); outline: 0; }
textarea { resize: vertical; min-height: 105px; }
.full-width { display: block; margin-top: 18px; }

.upload-box { margin-top: 22px; display: grid; grid-template-columns: 1fr auto; gap: 18px; padding: 20px; border: 1px dashed #9fb3c4; border-radius: 14px; background: #f8fafc; }
.upload-box h3 { margin: 0 0 4px; font-size: 1rem; }
.upload-box p { margin: 0; color: var(--muted); font-size: .88rem; }
.file-button { align-self: start; background: var(--blue-soft); color: var(--blue); padding: 9px 13px; border-radius: 9px; font-weight: 750; cursor: pointer; }
.file-list { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .88rem; }

.confirmations { display: grid; gap: 11px; margin-top: 22px; }
.checkbox-row { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 13px 14px; background: #f7f9fb; border-radius: 10px; }
.checkbox-row input { width: 18px; height: 18px; margin-top: 2px; }
.checkbox-row span { margin: 0; font-weight: 500; }

.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.actions.left { justify-content: flex-start; }
.button { border: 1px solid transparent; border-radius: 10px; padding: 10px 15px; font-weight: 750; }
.button.primary { background: var(--blue); color: white; box-shadow: 0 8px 18px rgba(22, 77, 122, .18); }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { border-color: #c8d2dc; background: white; color: var(--ink); }
.button.compact { padding: 8px 11px; font-size: .86rem; }

.message { margin-top: 18px; padding: 12px 14px; border-radius: 9px; }
.message.error { border: 1px solid #edc5c5; background: var(--danger-soft); color: var(--danger); }
.result-card { margin-top: 28px; padding: 23px; border: 1px solid #add8cb; border-radius: 16px; background: linear-gradient(135deg, #f4fbf9, #edf7fb); }
.result-card h3 { margin: 0; }
.result-card ol { margin: 12px 0 18px; padding-left: 22px; }
.key-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.key-row code { overflow-wrap: anywhere; display: block; padding: 12px 14px; border: 1px solid #a9c7bb; border-radius: 9px; background: white; color: #194f42; font-size: .92rem; }
.warning { color: var(--warning); font-size: .88rem; }

.opened-result { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 25px; }
.opened-header { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.opened-header h3 { margin: 0; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 18px 0 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.summary-item { padding: 13px 15px; border-bottom: 1px solid var(--line); background: white; }
.summary-item:nth-child(odd) { border-right: 1px solid var(--line); }
.summary-item dt { color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.summary-item dd { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.attachment-section { margin-top: 24px; }
.attachment-section h4 { margin-bottom: 10px; }
.attachment-list { display: grid; gap: 9px; }
.attachment-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }

.protocol { margin-top: 28px; padding: 30px; border-radius: 22px; background: #102b44; color: white; }
.protocol h2 { margin: 0 0 20px; }
.protocol-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.protocol article { border: 1px solid rgba(255,255,255,.15); border-radius: 14px; padding: 17px; background: rgba(255,255,255,.055); }
.protocol article span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #5ec2a4; color: #0e3c31; font-weight: 850; }
.protocol h3 { margin: 12px 0 6px; }
.protocol p { margin: 0; color: #c6d8e7; font-size: .89rem; }

footer { display: flex; justify-content: space-between; gap: 20px; max-width: 1120px; margin: 0 auto; padding: 0 28px 35px; color: var(--muted); font-size: .82rem; }

[hidden] { display: none !important; }

@media (max-width: 820px) {
  .site-header { grid-template-columns: auto 1fr; }
  .status-pill { grid-column: 1 / -1; justify-self: start; }
  .form-grid, .open-grid, .summary-grid { grid-template-columns: 1fr; }
  .summary-item:nth-child(odd) { border-right: 0; }
  .protocol-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .site-header, main { padding-left: 16px; padding-right: 16px; }
  .panel { padding: 20px 16px; }
  .panel-heading, .opened-header { display: block; }
  .privacy-label { margin-top: 10px; text-align: left; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; }
  .upload-box { grid-template-columns: 1fr; }
  .file-button { justify-self: start; }
  .key-row { grid-template-columns: 1fr; }
  .protocol-grid { grid-template-columns: 1fr; }
  footer { display: block; padding-left: 16px; padding-right: 16px; }
}
