:root {
  --ink: #17233f;
  --ink-soft: #59627a;
  --paper: #f5f5f1;
  --surface: #ffffff;
  --line: #e4e5df;
  --accent: #f5c742;
  --accent-strong: #e7b82f;
  --success: #278364;
  --danger: #bd4a44;
  --blue-soft: #edf2fb;
  --radius-lg: 24px;
  --radius-md: 15px;
  --shadow: 0 18px 55px rgba(20, 32, 58, 0.08);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
button, input { font: inherit; }
button, label[for] { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -0.02em; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: var(--accent); color: #1f2940; font-weight: 900; letter-spacing: -0.08em; box-shadow: inset 0 -3px 0 rgba(101, 72, 0, 0.12); }
.brand-light { color: #fff; }
.eyebrow { margin: 0 0 9px; color: #8a7040; font-size: 11px; font-weight: 850; letter-spacing: 0.16em; text-transform: uppercase; }
.eyebrow-light { color: var(--accent); }

.auth-screen { min-height: 100vh; background: var(--ink); position: relative; overflow: hidden; }
.auth-backdrop { position: absolute; inset: 0; pointer-events: none; }
.shape { position: absolute; display: block; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.shape-one { width: 620px; height: 620px; left: -260px; bottom: -280px; }
.shape-two { width: 380px; height: 380px; left: 33%; top: -230px; }
.shape-three { width: 12px; height: 12px; left: 44%; top: 58%; background: var(--accent); border: 0; box-shadow: 70px -190px 0 rgba(245,199,66,.25), -190px 170px 0 rgba(245,199,66,.18); }
.auth-layout { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(430px, .9fr); max-width: 1220px; min-height: 100vh; margin: 0 auto; padding: 48px; gap: 8vw; align-items: center; }
.auth-intro { align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; padding: 18px 0; color: #fff; }
.auth-copy { max-width: 620px; margin: auto 0; padding: 70px 0; }
.auth-copy h1 { margin: 0 0 25px; max-width: 620px; font-size: clamp(46px, 5.4vw, 78px); line-height: .98; letter-spacing: -.055em; }
.auth-copy > p:last-child { max-width: 540px; margin: 0; color: #bec5d2; font-size: 18px; line-height: 1.7; }
.auth-benefits { display: flex; gap: 28px; padding: 0; margin: 0; list-style: none; }
.auth-benefits li { max-width: 150px; color: #c8ced9; font-size: 12px; line-height: 1.45; }
.auth-benefits span { display: block; margin-bottom: 7px; color: var(--accent); font-weight: 800; }
.auth-card { width: 100%; max-width: 510px; justify-self: end; padding: 42px; border-radius: 28px; background: var(--surface); box-shadow: 0 35px 100px rgba(0,0,0,.25); }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 26px; font-weight: 800; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 5px; margin-bottom: 38px; border-radius: 12px; background: #f1f2ee; }
.auth-tab { padding: 12px; border: 0; border-radius: 9px; background: transparent; color: #757b8c; cursor: pointer; font-size: 13px; font-weight: 750; }
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: 0 3px 13px rgba(20,32,58,.08); }
.auth-panel { display: none; }
.auth-panel.active { display: block; animation: reveal .25s ease-out; }
.section-heading { margin-bottom: 28px; }
.section-heading h2 { margin: 0 0 10px; font-size: 31px; letter-spacing: -.035em; }
.section-heading > p:last-child { margin: 0; color: var(--ink-soft); line-height: 1.55; }
.form-stack { display: grid; gap: 19px; }
.field { display: grid; gap: 8px; }
.field > span:first-child { color: #49536b; font-size: 12px; font-weight: 750; }
.field input { width: 100%; height: 51px; padding: 0 15px; border: 1px solid #dcded8; border-radius: 11px; outline: 0; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field input::placeholder { color: #a8acb7; }
.field input:focus { border-color: #b8952f; box-shadow: 0 0 0 3px rgba(245,199,66,.2); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 82px; }
.reveal-password { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); padding: 5px 7px; border: 0; background: transparent; color: #8a7040; cursor: pointer; font-size: 11px; font-weight: 750; }
.form-error { min-height: 0; margin: -6px 0 0; color: var(--danger); font-size: 12px; line-height: 1.4; }
.form-error:empty { display: none; }
.legal-note { margin: -5px 0 0; color: #9196a3; font-size: 10px; line-height: 1.5; text-align: center; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-size: 13px; font-weight: 800; transition: transform .15s, background .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .7; transform: none; }
.button-primary { min-height: 51px; background: var(--accent); color: #20283b; box-shadow: inset 0 -3px 0 rgba(94,67,0,.12); }
.button-primary:hover { background: var(--accent-strong); }
.button-wide { width: 100%; }
.button-secondary { border-color: var(--line); background: #fff; }
.button-quiet { min-height: 38px; padding: 0 13px; background: transparent; color: var(--ink-soft); }

.topbar { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; min-height: 76px; margin: auto; padding: 0 24px; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.service-status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 999px; background: #edf7f2; color: #3c705d; font-size: 11px; font-weight: 750; }
.service-status i { width: 7px; height: 7px; border-radius: 50%; background: #4ca77f; box-shadow: 0 0 0 4px rgba(76,167,127,.13); }
.service-status.offline { background: #fbebea; color: var(--danger); }
.service-status.offline i { background: var(--danger); box-shadow: 0 0 0 4px rgba(189,74,68,.13); }
.profile-button { display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; }
.profile-copy { display: grid; gap: 1px; text-align: left; }
.profile-copy strong { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.profile-copy small { max-width: 150px; overflow: hidden; color: #8a90a0; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.main-content { max-width: 1200px; margin: 0 auto; padding: 58px 24px 90px; }
.page-intro { display: flex; justify-content: space-between; gap: 40px; align-items: flex-end; margin-bottom: 37px; }
.page-intro h1 { margin: 0 0 9px; font-size: clamp(34px, 4vw, 51px); line-height: 1; letter-spacing: -.055em; }
.page-intro > div > p:last-child { margin: 0; color: var(--ink-soft); line-height: 1.55; }
.steps { display: flex; gap: 0; min-width: 475px; padding: 0; margin: 0; list-style: none; }
.steps li { position: relative; display: flex; flex: 1; gap: 9px; align-items: center; color: #9b9faa; }
.steps li:not(:last-child)::after { position: absolute; top: 16px; left: 36px; right: 9px; height: 1px; background: #d8dad5; content: ""; }
.steps li > span { position: relative; z-index: 1; display: grid; flex: 0 0 32px; height: 32px; place-items: center; border: 1px solid #d9dbd6; border-radius: 50%; background: var(--paper); font-size: 11px; font-weight: 850; }
.steps div { position: relative; z-index: 2; padding-right: 8px; background: var(--paper); }
.steps strong, .steps small { display: block; }
.steps strong { color: #757b8d; font-size: 11px; }
.steps small { margin-top: 2px; font-size: 9px; }
.steps li.active > span { border-color: var(--accent); background: var(--accent); color: var(--ink); }
.steps li.active strong { color: var(--ink); }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, .78fr); gap: 22px; align-items: start; }
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.upload-card { padding: 31px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 23px; }
.card-heading > div { display: flex; align-items: center; gap: 12px; }
.card-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.card-heading.compact { margin-top: 0; }
.heading-index { color: #9c8250; font-size: 10px; font-weight: 850; }
.format-pill { padding: 6px 9px; border-radius: 7px; background: #f4f1e8; color: #827047; font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.dropzone { display: grid; min-height: 215px; place-items: center; align-content: center; padding: 25px; border: 1.5px dashed #c9cbc5; border-radius: var(--radius-md); background: #fafaf8; cursor: pointer; text-align: center; transition: border-color .15s, background .15s, transform .15s; }
.dropzone:hover, .dropzone.dragover { border-color: #bd9430; background: #fffaf0; transform: translateY(-1px); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { display: grid; width: 43px; height: 43px; margin-bottom: 13px; place-items: center; border-radius: 13px; background: var(--accent); font-size: 23px; font-weight: 400; }
.dropzone strong { margin-bottom: 6px; font-size: 14px; }
.dropzone > span:not(.upload-icon) { color: #73798a; font-size: 12px; }
.dropzone u { color: #80671f; font-weight: 750; text-decoration: none; }
.dropzone small { margin-top: 14px; color: #a0a4ae; font-size: 10px; }
.selected-file { display: flex; align-items: center; gap: 13px; min-height: 72px; padding: 12px 14px; border: 1px solid #dedfd9; border-radius: 13px; background: #fafaf8; }
.file-badge { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 10px; background: var(--ink); color: #fff; font-size: 10px; font-weight: 900; }
.selected-file div { display: grid; flex: 1; gap: 4px; min-width: 0; }
.selected-file strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.selected-file small { color: #858a98; font-size: 10px; }
.selected-file button { width: 31px; height: 31px; border: 0; border-radius: 8px; background: transparent; color: #8e93a0; cursor: pointer; font-size: 21px; }
.upload-progress { display: grid; gap: 8px; padding: 13px 14px; margin-top: 12px; border: 1px solid #cfe0ff; border-radius: 13px; background: #f3f7ff; }
.upload-progress[hidden] { display: none; }
.upload-progress > div:first-child { display: flex; justify-content: space-between; gap: 12px; color: #34435f; font-size: 11px; }
.upload-progress > div:first-child span { color: #1765e5; font-weight: 800; }
.upload-progress small { color: #687694; font-size: 10px; }
.upload-progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: #dbe7fa; }
.upload-progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: #1765e5; transition: width .18s ease; }
.divider { height: 1px; margin: 30px 0; background: var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.security-note { display: flex; gap: 11px; align-items: flex-start; padding: 14px 15px; margin-top: 20px; border-radius: 12px; background: var(--blue-soft); color: #53617c; }
.security-note > span { color: #6e7f9f; font-size: 11px; }
.security-note p { margin: 0; font-size: 10px; line-height: 1.55; }
.security-note strong { color: #35425d; }
.submit-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 25px; }
.submit-row p { max-width: 200px; margin: 0; color: #8d919c; font-size: 10px; line-height: 1.5; }
.submit-row .button { min-width: 205px; }
.billing-control { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; color: #66728a; font-size: 10px; }
.billing-control > span { width: 100%; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.billing-control strong { color: var(--ink); font-size: 22px; line-height: 1; }
.billing-control .button { min-width: 0; min-height: 37px; padding: 0 13px; font-size: 10px; }
.side-column { display: grid; gap: 20px; }
.process-card { padding: 30px; }
.process-card h2 { margin: 0 0 27px; font-size: 23px; letter-spacing: -.035em; }
.process-list { display: grid; gap: 0; padding: 0; margin: 0; list-style: none; }
.process-list li { position: relative; display: flex; gap: 13px; padding-bottom: 28px; }
.process-list li:not(:last-child)::before { position: absolute; top: 30px; bottom: 2px; left: 14px; width: 1px; background: #e0e1dc; content: ""; }
.process-list li > span { position: relative; z-index: 1; display: grid; flex: 0 0 29px; height: 29px; place-items: center; border-radius: 50%; background: #f3f1e9; color: #8b7549; font-size: 9px; font-weight: 850; }
.process-list li:first-child > span { background: var(--accent); color: var(--ink); }
.process-list strong, .process-list small { display: block; }
.process-list strong { margin: 2px 0 4px; font-size: 12px; }
.process-list small { color: #858a98; font-size: 10px; line-height: 1.45; }
.privacy-box { padding: 18px; border-radius: 14px; background: var(--ink); color: #fff; }
.privacy-box strong { font-size: 11px; }
.privacy-box p { margin: 7px 0 0; color: #c2c8d5; font-size: 10px; line-height: 1.5; }

.history-section { padding-top: 58px; }
.history-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 19px; }
.history-heading h2 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.empty-state { display: grid; min-height: 230px; place-items: center; align-content: center; padding: 30px; border: 1px dashed #d2d4ce; border-radius: var(--radius-lg); color: #8a8f9b; text-align: center; }
.empty-state > span { font-size: 34px; color: #c0a352; }
.empty-state h3 { margin: 13px 0 6px; color: var(--ink); font-size: 15px; }
.empty-state p { margin: 0; font-size: 11px; }
.audit-list { display: grid; gap: 12px; }
.audit-item { display: grid; grid-template-columns: minmax(190px, 1.25fr) minmax(150px,.7fr) minmax(190px,1fr) auto; gap: 18px; align-items: center; padding: 18px 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 8px 30px rgba(20,32,58,.035); }
.audit-file { display: flex; gap: 12px; align-items: center; min-width: 0; }
.audit-file .file-badge { flex: 0 0 39px; height: 39px; }
.audit-file div { min-width: 0; }
.audit-file strong, .audit-file small { display: block; }
.audit-file strong { overflow: hidden; margin-bottom: 4px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.audit-file small, .audit-period { color: #858a98; font-size: 10px; }
.audit-file .result-summary { margin-top: 4px; color: #59627a; font-weight: 700; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; width: fit-content; padding: 7px 10px; border-radius: 999px; background: #f2f2ee; color: #626878; font-size: 10px; font-weight: 800; }
.status-pill::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status-pill.active { background: #fff5d8; color: #8d6c11; }
.status-pill.completed { background: #eaf6f0; color: var(--success); }
.status-pill.failed { background: #fbebea; color: var(--danger); }
.progress-wrap { display: grid; gap: 6px; }
.progress-label { display: flex; justify-content: space-between; color: #73798a; font-size: 9px; }
.progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: #e9eae5; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s ease; }
.audit-action { min-width: 130px; }
.audit-action .button { width: 100%; min-height: 39px; font-size: 11px; }
.waiting-label { display: block; color: #9a9ea8; font-size: 10px; text-align: center; }

footer { display: flex; justify-content: space-between; max-width: 1200px; padding: 25px 24px 40px; margin: 0 auto; border-top: 1px solid #dedfd9; color: #999da7; font-size: 10px; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: min(380px, calc(100vw - 48px)); padding: 14px 18px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: 0 15px 50px rgba(0,0,0,.22); font-size: 12px; line-height: 1.45; opacity: 0; pointer-events: none; transform: translateY(12px); transition: .22s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #883d39; }

@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 960px) {
  .auth-layout { grid-template-columns: 1fr; padding: 30px 24px; }
  .auth-intro { display: none; }
  .auth-card { justify-self: center; }
  .auth-mobile-brand { display: flex; }
  .page-intro { align-items: flex-start; flex-direction: column; }
  .steps { width: 100%; min-width: 0; }
  .workspace-grid { grid-template-columns: 1fr; }
  .side-column { grid-row: 2; }
  .process-card { display: grid; grid-template-columns: 1fr 1.4fr; column-gap: 30px; }
  .process-card .eyebrow, .process-card h2 { grid-column: 1; }
  .process-list { grid-column: 2; grid-row: 1 / span 3; }
  .privacy-box { grid-column: 1; align-self: end; }
  .audit-item { grid-template-columns: 1fr .7fr 1fr; }
  .audit-action { grid-column: 3; }
}
@media (max-width: 680px) {
  .auth-layout { padding: 0; }
  .auth-card { min-height: 100vh; max-width: none; padding: 28px 22px; border-radius: 0; }
  .auth-tabs { margin-bottom: 30px; }
  .topbar-inner { min-height: 66px; padding: 0 16px; }
  .topbar .brand > span:last-child, .service-status, .profile-copy, .profile-button > span:last-child { display: none; }
  .top-actions { gap: 6px; }
  .main-content { padding: 38px 15px 65px; }
  .page-intro { gap: 25px; margin-bottom: 27px; }
  .steps li { align-items: flex-start; }
  .steps div { display: none; }
  .steps li:not(:last-child)::after { right: -4px; }
  .upload-card, .process-card { padding: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .submit-row { align-items: stretch; flex-direction: column; }
  .submit-row p { max-width: none; }
  .billing-control { justify-content: space-between; }
  .billing-control > span { width: auto; }
  .process-card { display: block; }
  .process-card h2 { margin-bottom: 24px; }
  .privacy-box { margin-top: 4px; }
  .history-section { padding-top: 45px; }
  .history-heading { align-items: center; }
  .audit-item { grid-template-columns: 1fr auto; gap: 14px; }
  .audit-period { text-align: right; }
  .progress-wrap { grid-column: 1 / -1; }
  .audit-action { grid-column: 1 / -1; }
  footer { gap: 8px; flex-direction: column; padding-left: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
