
:root {
  --primary: #5145ff;
  --primary-dark: #4035e6;
  --ink: #151b2c;
  --muted: #647087;
  --line: #e5e8f0;
  --surface: #ffffff;
  --page: #f7f8fc;
  --soft-purple: #f0efff;
  --green: #16834a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #a5a0ff; outline-offset: 3px;
}
[hidden] { display: none !important; }

.hero { text-align: center; padding: 23px 20px 27px; }
.brand { display: inline-block; font-weight: 800; font-size: 17px; letter-spacing: -.6px; }
.brand span, h1 span { color: var(--primary); }
.trust { display: flex; justify-content: center; gap: 8px; margin: 15px 0; flex-wrap: wrap; }
.trust span { font-size: 11px; color: var(--green); border: 1px solid #ccefd9; background: #f0fff5; padding: 5px 10px; border-radius: 99px; }
h1 { margin: 15px 0 8px; font-size: clamp(27px, 4vw, 40px); line-height: 1.18; letter-spacing: -1.5px; }
.subtitle { color: var(--muted); line-height: 1.7; margin: 0 auto 20px; max-width: 560px; }
.tabs { display: inline-flex; gap: 3px; background: #f0f1f6; padding: 4px; border-radius: 9px; }
.tab { padding: 10px 15px; border-radius: 7px; font-size: 12px; color: #586176; }
.tab.active { background: white; color: var(--ink); box-shadow: 0 1px 3px #00000012; }

.container { max-width: 1000px; margin: 0 auto; padding: 0 20px 50px; }
.home-workspace, .workspace {
  display: grid; grid-template-columns: 0.9fr 1.1fr; background: var(--surface);
  border: 1px solid #eceef4; border-radius: 17px; overflow: hidden;
  box-shadow: 0 9px 20px #151b2c0b, 0 3px 6px #151b2c0b;
}
.exam-sidebar, .config-panel { padding: 24px; min-width: 0; background: #fdfdff; }
.home-preview, .process-panel { padding: 24px; min-width: 0; border-left: 1px solid #f0f1f5; }
.step-title { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; }
.step-title h2 { font-size: 15px; margin: 0; letter-spacing: -.2px; }
.step-number { display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: var(--primary); color: white; font-size: 12px; font-weight: 700; flex-shrink: 0; }
label { display: block; font-size: 12px; font-weight: 600; margin: 12px 0 7px; }
.search, .file-meta, .field {
  width: 100%; min-width: 0; border: 1px solid var(--line); background: white;
  border-radius: 8px; padding: 12px; color: var(--ink);
}
.search::placeholder { color: #8b93a6; }
.muted { color: var(--muted); }
.small { font-size: 11px; line-height: 1.6; }
#exam-count { margin: 10px 0; }
.exam-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.exam-card { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 10px; background: white; transition: border-color .15s, transform .15s; }
.exam-card:hover { border-color: #aaa5ff; transform: translateY(-1px); }
.exam-logo { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 9px; font-size: 11px; font-weight: 800; }
.exam-card strong { font-size: 12px; display: block; line-height: 1.4; }
.exam-card small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.empty-state { min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.empty-icon { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: #f3f4ff; color: #aaa6ff; font-size: 48px; }
.empty-state h3 { font-size: 16px; margin: 20px 0 4px; }
.empty-state p { max-width: 290px; color: var(--muted); line-height: 1.7; }
.error { color: #b42318; font-size: 12px; }

.info-section { padding-top: 60px; }
.eyebrow { font-size: 11px; font-weight: 800; color: var(--primary); letter-spacing: 1.5px; }
.info-section > h2 { font-size: 26px; letter-spacing: -.8px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-top: 25px; }
.feature { border: 1px solid var(--line); border-radius: 13px; padding: 20px; background: white; }
.feature > span { color: var(--primary); font-weight: 800; }
.feature h3 { font-size: 15px; }
.feature p { color: var(--muted); line-height: 1.7; font-size: 12px; }
.footer { padding: 22px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 11px; }

/* Exam page */
.exam-header { max-width: 1000px; margin: 0 auto; padding: 25px 20px 20px; text-align: center; }
.back-link { display: inline-block; margin-bottom: 16px; color: var(--muted); font-size: 12px; }
.exam-header h1 { font-size: clamp(24px, 3.5vw, 34px); }
.exam-header .subtitle { margin-bottom: 12px; }
.workspace { max-width: 1000px; margin: 0 auto 40px; }
.config-panel { padding: 23px; }
.process-panel { padding: 23px; }
.selected-exam { padding: 13px; background: var(--soft-purple); border: 1px solid #c9c5ff; border-radius: 9px; margin-bottom: 18px; }
.selected-exam strong { display: block; font-size: 13px; }
.selected-exam small { color: var(--primary); font-size: 10px; }
.mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0 18px; }
.mode-button { border: 1px solid var(--line); border-radius: 10px; background: white; padding: 15px 8px; color: var(--ink); }
.mode-button .mode-icon { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 auto 8px; border-radius: 50%; background: #f0f1f6; font-size: 18px; }
.mode-button strong { display: block; font-size: 12px; }
.mode-button small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.mode-button.active { color: white; background: var(--primary); border-color: var(--primary); }
.mode-button.active .mode-icon { background: #ffffff30; }
.mode-button.active small { color: #e7e5ff; }
.requirements { padding: 14px; border: 1px solid #c9c5ff; border-radius: 10px; background: #f6f5ff; margin-bottom: 18px; }
.requirements h3, .adjustments h3, .result-card h3 { margin: 0 0 12px; font-size: 12px; }
.requirement-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.requirement { padding: 9px 7px; border: 1px solid #dedbff; border-radius: 6px; background: white; min-width: 0; }
.requirement small { display: block; font-size: 9px; color: var(--muted); }
.requirement strong { display: block; font-size: 10px; margin-top: 5px; overflow-wrap: anywhere; }
.adjustments, .result-card { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.range-row { margin: 13px 0; }
.range-label { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.range-label output { color: var(--primary); font-weight: 700; }
input[type="range"] { width: 100%; accent-color: var(--primary); margin-top: 10px; }
.file-drop { border: 1.5px dashed #c9c5ff; background: #fafaff; border-radius: 12px; padding: 24px 15px; text-align: center; }
.file-drop.dragging { background: #efedff; border-color: var(--primary); }
.file-drop input { max-width: 100%; }
.file-drop p { color: var(--muted); font-size: 11px; line-height: 1.6; }
.primary-button, .secondary-button { border: 1px solid var(--line); border-radius: 8px; padding: 11px 14px; font-size: 12px; font-weight: 700; }
.primary-button { background: var(--primary); color: white; border-color: var(--primary); }
.primary-button:hover { background: var(--primary-dark); }
.secondary-button { background: white; color: var(--ink); }
.primary-button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.file-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; margin: 15px 0; overflow-wrap: anywhere; }
.file-meta button { border: 0; background: transparent; color: var(--muted); }
.preview-wrap { background: #101828; border-radius: 8px; padding: 15px; margin: 15px 0; min-height: 210px; display: grid; place-items: center; overflow: hidden; }
.preview-wrap canvas { max-width: 100%; max-height: 320px; object-fit: contain; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.result-preview { min-width: 0; text-align: center; }
.result-preview img { display: block; width: 100%; height: 155px; object-fit: contain; border: 1px solid var(--line); border-radius: 7px; background-color: #f8fafc; background-image: linear-gradient(45deg,#e9edf3 25%,transparent 25%),linear-gradient(-45deg,#e9edf3 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e9edf3 75%),linear-gradient(-45deg,transparent 75%,#e9edf3 75%); background-size: 16px 16px; background-position: 0 0,0 8px,8px -8px,-8px 0; }
.result-preview p { font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.result-status { margin-top: 15px; padding: 12px; border-radius: 8px; font-size: 11px; line-height: 1.7; }
.result-status.success { color: #166534; background: #effdf3; border: 1px solid #bbf7d0; }
.result-status.warning { color: #92400e; background: #fffbeb; border: 1px solid #fde68a; }
.privacy-note { margin-top: 25px; padding-top: 15px; border-top: 1px solid var(--line); text-align: center; font-size: 10px; line-height: 1.7; color: var(--muted); }

@media (max-width: 720px) {
  .hero { padding: 18px 15px 22px; }
  .container { padding: 0 12px 35px; }
  .home-workspace, .workspace { grid-template-columns: 1fr; border-radius: 13px; }
  .exam-sidebar, .config-panel { padding: 18px; }
  .home-preview, .process-panel { border-left: 0; border-top: 1px solid var(--line); padding: 18px; }
  .empty-state { min-height: 230px; }
  .feature-grid { grid-template-columns: 1fr; }
  .info-section { padding-top: 35px; }
  .info-section > h2 { font-size: 22px; }
  .exam-header { padding-top: 15px; }
}
@media (max-width: 390px) {
  .exam-list { grid-template-columns: 1fr; }
  .requirement-grid { grid-template-columns: 1fr; }
  .result-grid { gap: 7px; }
  .result-preview img { height: 120px; }
}
