/* css/style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --border: #e8e6e0;
  --border-strong: #c8c5bc;
  --text: #1a1916;
  --text-muted: #6b6860;
  --text-light: #9b9890;
  --accent: #1a1916;
  --accent-soft: #f0efe9;
  --tag-bg: #f0efe9;
  --tag-text: #4a4840;
  --success: #2d6a4f;
  --success-bg: #e8f5ee;
  --warn: #7d4f00;
  --warn-bg: #fef3e2;
  --section-num: #c5c2b8;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}

/* ── HEADER ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-badge {
  width: 28px;
  height: 28px;
  background: var(--text);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-badge svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.logo-name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
}
.logo-name span {
  color: var(--text-muted);
  font-weight: 300;
}
.confidential-badge {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
}

/* ── HERO ── */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 2rem 3rem;
}
.hero-inner {
  max-width: 780px;
  margin: 0 auto;
}
.hero-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text);
}
.hero h1 strong { font-weight: 500; }
.hero p {
  max-width: 540px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}

/* ── MAIN LAYOUT ── */
main {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

/* ── SECTION ── */
.section {
  margin-bottom: 3.5rem;
}
.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.section-num {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--section-num);
  font-weight: 400;
  min-width: 20px;
}
.section-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── PRINCIPLES GRID ── */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.principle-card {
  background: var(--surface);
  padding: 1.25rem 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.principle-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.principle-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.principle-icon svg { width: 14px; height: 14px; fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.principle-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.principle-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── FLOW TABLE ── */
.flow-table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  border-spacing: 0;
  border-collapse: separate;
}
.flow-table thead tr {
  background: var(--accent-soft);
}
.flow-table thead th {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.flow-table tbody tr {
  background: var(--surface);
  transition: background 0.15s;
}
.flow-table tbody tr:hover { background: #fdfdfc; }
.flow-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid var(--border);
}
.flow-table td {
  padding: 12px 14px;
  vertical-align: top;
  font-size: 13.5px;
}
.flow-table td:first-child {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
  width: 28px;
}
.flow-table td:nth-child(2) {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  width: 140px;
}
.flow-table td:last-child {
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── FORM ── */
.form-grid {
  display: grid;
  gap: 1.25rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-group label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.form-group input,
.form-group textarea,
.form-group select {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 12px;
  outline: none;
  transition: all 0.2s;
  width: 100%;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.form-group textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.anon-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
}
.anon-toggle:hover { border-color: var(--border-strong); background: #fdfdfc; }
.anon-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.anon-toggle-text { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.anon-toggle-text strong { display: block; color: var(--text); font-weight: 500; margin-bottom: 2px; }

/* ── CHECKBOXES ── */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.1s;
  font-size: 13px;
  color: var(--text);
}
.checkbox-item:hover { background: var(--accent-soft); }
.checkbox-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── RADIO BUTTONS ── */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.radio-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 30px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
  transition: all 0.2s ease;
  user-select: none;
}
.radio-pill:hover { border-color: var(--border-strong); color: var(--text); }
.radio-pill input { display: none; }
.radio-pill.selected { background: var(--text); color: #fff; border-color: var(--text); transform: scale(1.05); }

/* ── PERSONS TABLE ── */
.persons-table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  border-spacing: 0;
  border-collapse: separate;
}
.persons-table thead tr { background: var(--accent-soft); }
.persons-table thead th {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.persons-table tbody tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
.persons-table td {
  padding: 0;
  background: var(--surface);
}
.persons-table td:first-child {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  width: 36px;
  background: var(--accent-soft);
  border-right: 1px solid var(--border);
}
.persons-table td input {
  border: none;
  border-radius: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13.5px;
  color: var(--text);
  background: transparent;
  padding: 10px 12px;
  width: 100%;
  outline: none;
}
.persons-table td input:focus { background: var(--accent-soft); }
.persons-table td:not(:last-child) { border-right: 1px solid var(--border); }

/* ── EVIDENCE CHECKS ── */
.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.evidence-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.evidence-item:last-child { border-bottom: none; }
.evidence-item:hover { background: var(--accent-soft); }
.evidence-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--text);
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}
.evidence-item-text { font-size: 13.5px; color: var(--text); line-height: 1.5; }
.evidence-item-text input[type="text"] {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  color: var(--text);
  background: transparent;
  padding: 2px 0;
  width: 200px;
  outline: none;
  margin-left: 4px;
}
.evidence-item-text input[type="text"]:focus { border-color: var(--border-strong); }

/* ── PRIVACY ── */
.privacy-accordion {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.privacy-item {
  border-bottom: 1px solid var(--border);
}
.privacy-item:last-child { border-bottom: none; }
.privacy-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: var(--surface);
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.15s;
  gap: 12px;
}
.privacy-trigger:hover { background: var(--accent-soft); }
.privacy-trigger .num {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-light);
  min-width: 28px;
}
.privacy-trigger .chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.privacy-trigger.open .chevron { transform: rotate(180deg); }
.privacy-content {
  display: none;
  padding: 0 16px 16px 55px;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.7;
  background: var(--surface);
  animation: slideDown 0.3s ease-out;
}
.privacy-content.open { display: block; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── CONSENT ── */
.consent-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  background: var(--surface);
}
.consent-box p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
  font-style: italic;
}
.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
}
.consent-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--text);
  margin-top: 2px;
  flex-shrink: 0;
}

/* ── SIGNATURE ROW ── */
.sig-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

/* ── SUBMIT ── */
.submit-area {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.submit-note {
  font-size: 12px;
  color: var(--text-light);
  max-width: 320px;
  line-height: 1.5;
}
.submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.submit-btn:hover { opacity: 0.85; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.submit-btn:active { transform: scale(0.98); }
.submit-btn svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── SUCCESS MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,25,22,0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.3s ease;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--surface);
  border-radius: 14px;
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  animation: modalIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-icon {
  width: 52px;
  height: 52px;
  background: var(--success-bg);
  border-radius: 50%;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--success); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.modal-icon--warn { background: var(--warn-bg); }
.modal-icon--warn svg { stroke: var(--warn); }
.invalid-file-list {
  list-style: none;
  text-align: left;
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 10px 14px;
  margin: -0.75rem 0 1.25rem;
  max-height: 120px;
  overflow-y: auto;
}
.invalid-file-list:empty { display: none; }
.invalid-file-list li {
  padding: 3px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-box h3 { font-size: 18px; font-weight: 500; margin-bottom: 0.5rem; }
.modal-box p { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; margin-bottom: 1.5rem; }
.modal-exp {
  font-family: 'DM Mono', monospace;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 10px 18px;
  display: inline-block;
  margin-bottom: 1.5rem;
}
.modal-close {
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 10px 22px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}
.modal-close:hover { opacity: 0.85; }

/* ── NOTICE BANNERS ── */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.notice-warn { background: var(--warn-bg); color: var(--warn); border-color: #fce8cc; }
.notice svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; margin-top: 1px; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  background: var(--surface);
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .sig-row { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.5rem; }
  .submit-area { flex-direction: column; }
  .submit-btn { width: 100%; justify-content: center; }
}

.loader {
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
    margin-right: 8px;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}
