/* AVVOCATOS design system. Brand reference: owner-supplied nine-page PDF.
   Logical properties support RTL without duplicating component rules. */
:root {
  color-scheme: light;
  --red: #b61b1f;
  --red-hover: #97171b;
  --red-soft: #f8e9e9;
  --bg: #f1f0f0;
  --surface: #ffffff;
  --ink: #29272a;
  --muted: #625e62;
  --border: #dcd8d9;
  --charcoal: #343033;
  --success: #215b3b;
  --radius: 18px;
  --shadow: 0 12px 36px #34272c0b;
  --content-width: 1200px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.7 Tahoma, Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button, a, input, select { min-height: 44px; }
button { cursor: pointer; border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; font-weight: 700; line-height: 1.6; transition: background-color .15s, border-color .15s; }
button:disabled { opacity: .6; cursor: wait; }
a { color: var(--red); text-underline-offset: 4px; }
a, p, b, h1, h2, h3, .item, dd { overflow-wrap: anywhere; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #c8c1c4; border-radius: 10px; padding: 12px 14px; background: #faf9f9; color: var(--ink); font-size: 16px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #777176; }
input:focus, select:focus, textarea:focus { border-color: var(--red); background: white; }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 20px; accent-color: var(--red); vertical-align: middle; }
input[type="file"] { white-space: normal; }
textarea { min-height: 110px; resize: vertical; }
label { display: block; margin-bottom: 6px; }
h1, h2, h3 { line-height: 1.5; }
h1 { font-size: clamp(24px, 2.3vw, 32px); margin: 0 0 24px; }
h2 { font-size: clamp(19px, 1.8vw, 24px); margin: 0 0 16px; }
h3 { font-size: 18px; margin: 0 0 10px; }
p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }
.primary { background: var(--red); color: white; box-shadow: 0 3px 8px #b61b1f19; }
.primary:hover { background: var(--red-hover); }
.ghost { background: white; border-color: #d3cccf; color: var(--ink); }
.ghost:hover { background: #f7f2f3; border-color: #b9adb2; }
.danger { background: #fff4f3; color: #9c1720; border-color: #d8b9bd; }
.text-button { background: transparent; color: var(--red); padding: 6px 0; text-align: start; }
.text-button:hover { text-decoration: underline; }
.button-link { display: inline-flex; justify-content: center; align-items: center; text-decoration: none; padding: 10px 20px; border-radius: 10px; font-weight: 700; }
.muted { color: var(--muted); }
.small, .field-hint { font-size: 13px; line-height: 1.8; }
.field-hint { color: var(--muted); margin: -4px 0 0; }
.hidden, [hidden] { display: none !important; }
.ui-icon { width: 24px; height: 24px; flex: 0 0 auto; }
.skip-link { position: fixed; top: 8px; inset-inline-start: 12px; z-index: 200; padding: 10px 18px; background: white; border: 2px solid var(--red); transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.header { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px max(20px, calc((100% - var(--content-width))/2)); background: white; border-bottom: 1px solid var(--border); }
.header .logo { font-size: clamp(20px, 2vw, 26px); }
.logo, .wordmark { color: var(--red); font: 900 27px/1.3 Arial, sans-serif; letter-spacing: -1px; }
.brand-button { background: transparent; border: 0; padding: 0; }
.header-actions, .header nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.header-actions { justify-content: flex-end; }
.header nav button { font-size: 14px; }
#install-app { font-size: 13px; background: #f5f1f2; }
.shell { max-width: 1500px; margin: auto; display: grid; grid-template-columns: 235px minmax(0,1fr); min-height: calc(100dvh - 80px); }
aside { background: var(--charcoal); padding: 28px 16px; color: white; min-width: 0; }
.workspace-label { font-size: 12px; color: #d4c8cf; margin: 0 12px 16px; }
.nav { display: block; width: 100%; text-align: start; background: transparent; color: #e7e1e4; margin: 4px 0; border-radius: 9px; padding: 11px 14px; font-size: 14px; font-weight: 400; }
.nav:hover { background: #494147; }
.nav.active { background: var(--red); color: white; font-weight: 700; }
.main { min-width: 0; padding: clamp(20px, 3vw, 40px); }
.main > h1 { padding-bottom: 16px; border-bottom: 1px solid #d7cfd2; }
.public-main { max-width: var(--content-width); margin: auto; }
.card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(18px, 2.4vw, 28px); margin-bottom: 20px; box-shadow: var(--shadow); }
.card h2:first-child { padding-bottom: 13px; border-bottom: 1px solid #eee9eb; }
.card h2:empty { display: none; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid, .three { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.grid .card { margin: 0; }
.stat { padding: 24px; background: white; border: 1px solid var(--border); border-top: 3px solid var(--red); border-radius: 14px; }
.stat strong { font-size: 30px; display: block; color: var(--red); }
.form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.field { min-width: 0; }
.field label { color: #4c454a; font-size: 14px; font-weight: 700; }
.span { grid-column: 1 / -1; }
.form-error { border: 1px solid #cd8a90; border-inline-start: 4px solid #a51823; padding: 12px 16px; border-radius: 9px; background: #fff0f0; color: #86121b; }
.item { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 18px 0; border-bottom: 1px solid #e4dfe2; }
.item > div { min-width: 0; }
.item p { margin: 7px 0; }
.item:last-child { border-bottom: 0; }
.tag, .badge { display: inline-block; border-radius: 7px; padding: 4px 10px; font-size: 12px; background: #eee9ec; color: #514950; }
.badge { background: var(--red-soft); color: #98151b; }
.badge-ok { background: #e7f4ec; color: var(--success); }
.entry { border-inline-start: 2px solid #d4c8ce; padding: 10px 18px; margin: 16px 3px; position: relative; }
.entry::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--red); position: absolute; inset-inline-start: -6px; top: 18px; }
.chat { height: 320px; overflow: auto; padding: 16px; border: 1px solid var(--border); background: #f0ebee; border-radius: 12px; margin-bottom: 20px; }
.bubble { padding: 16px; border-radius: 12px; background: white; border: 1px solid #ddd4d8; margin: 10px 0; max-width: 90%; }
.bubble.mine { background: #fbe2e3; border-color: #e5bfc2; margin-inline-start: auto; }
.chat-answer { white-space: pre-line; }
.alert { padding: 15px 18px; background: #fff4e6; border: 1px solid #dfc5a3; border-radius: 10px; margin: 14px 0 20px; color: #6b421d; font-size: 14px; }
.notice { border-inline-start: 4px solid var(--red); }
.ok { background: #eaf5ed; border-color: #a9ceb8; color: #234c33; }
.error { color: #9d111a; }
.toast { position: fixed; bottom: max(20px,env(safe-area-inset-bottom)); inset-inline: 20px; width: max-content; max-width: min(600px,calc(100% - 40px)); margin-inline: auto; padding: 15px 20px; border-radius: 12px; background: #30282e; color: white; box-shadow: 0 12px 35px #0003; z-index: 100; overflow-wrap: anywhere; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tabs button { flex: 0 1 auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.activeText { color: var(--red); font-weight: 700; }
.inline-link { text-decoration: none; }
.profile-url { direction: ltr; text-align: left; }
.bio { max-width: 65ch; white-space: pre-wrap; }
.sensitive { overflow-wrap: anywhere; user-select: all; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.ocr-text { font-family: inherit; line-height: 1.9; max-height: 65vh; overflow: auto; }
.loading { padding: 48px; text-align: center; color: var(--muted); }
dl { display: grid; grid-template-columns: minmax(100px,auto) minmax(0,1fr); gap: 12px; }
dd { margin: 0; }
.footnote { font-size: 12px; color: var(--muted); }
details { border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
summary { cursor: pointer; font-weight: 700; min-height: 28px; }
details[open] summary { margin-bottom: 16px; }
dialog { max-width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; border: 1px solid var(--border); border-top: 5px solid var(--red); border-radius: 18px; padding: 28px; box-shadow: 0 30px 100px #0004; }
dialog::backdrop { background: #27212799; }
/* Public home: substantial brand surfaces, not arbitrary color on form fields. */
.landing { max-width: var(--content-width); margin: auto; padding: 40px 20px 64px; }
.hero-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,.9fr); gap: 44px; align-items: stretch; padding: 28px 0 52px; }
.hero-copy { align-self: center; padding: 12px 0; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; color: var(--red); letter-spacing: .3px; margin-bottom: 14px; }
.hero-copy h1 { font-size: clamp(30px, 3.2vw, 46px); line-height: 1.65; margin: 0 0 18px; letter-spacing: -1px; }
.hero-copy h1 span { color: var(--red); }
.hero-description { color: #5c545a; max-width: 46ch; font-size: 17px; }
.search { display: flex; align-items: end; gap: 10px; padding: 18px; background: white; border: 1px solid #ded5da; border-radius: 16px; box-shadow: var(--shadow); margin: 26px 0 20px; }
.search .field { flex: 1; }
.search .span { flex: 0 0 auto; }
.search .form-error { flex: 1 1 100%; }
.search input { background: #f4f1f3; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.brand-panel { background: var(--red); color: white; position: relative; overflow: hidden; isolation: isolate; border-radius: 22px; }
.brand-panel::after { content: ''; position: absolute; inset-inline-end: -50px; bottom: -20px; width: 270px; height: 140px; background: repeating-linear-gradient(-23deg,transparent 0 17px,#ffffff20 18px 21px,transparent 22px 34px); z-index: -1; }
.brand-kicker { font: 900 22px/1.4 Arial,sans-serif; letter-spacing: -.8px; }
.hero-panel { padding: 32px; min-height: 440px; display: flex; flex-direction: column; align-items: start; }
.legal-mark { padding: 20px; background: #ffffff13; border: 1px solid #ffffff42; border-radius: 20px; margin: 36px 0 24px; }
.legal-mark .ui-icon { width: 48px; height: 48px; display: block; }
.hero-panel h2 { font-size: clamp(22px,2.4vw,30px); }
.brand-panel p { color: #fff1f1; font-size: 15px; max-width: 36ch; }
.brand-rule { width: 80px; height: 2px; background: #ffffff94; margin: 24px 0; }
.brand-caption { color: #fff1f1; font-size: 12px; margin-top: auto; }
.how-section { padding: 30px 0 48px; border-top: 1px solid var(--border); }
.section-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.section-heading h2, .portal-section h2 { font-size: clamp(24px,2.2vw,30px); margin-bottom: 8px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.feature-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.feature-card { padding: 28px; border: 1px solid var(--border); border-radius: 16px; background: white; }
.feature-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.feature-icon { display: inline-flex; padding: 12px; border-radius: 12px; background: var(--red-soft); color: var(--red); }
.step-number { color: #9c8d95; font: 500 18px Arial,sans-serif; }
.feature-card p { color: var(--muted); font-size: 14px; }
.portal-section { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.5fr); gap: 30px; align-items: center; padding: 32px; background: #e8e2e5; border: 1px solid #ded5da; border-radius: 20px; }
.portal-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.portal-links a { padding: 18px 20px; border: 1px solid #d6cbd1; border-radius: 12px; color: var(--ink); background: white; text-decoration: none; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px; }
.portal-links a:hover { border-color: var(--red); background: #fff9f9; }
.portal-links a b { font-size: 15px; }
.portal-links a span { font-size: 12px; color: var(--muted); grid-column: 1; }
.portal-links .ui-icon { grid-column: 2; grid-row: 1/3; align-self: center; color: var(--red); width: 20px; }
.public-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: var(--content-width); margin: auto; padding: 24px 20px max(24px,env(safe-area-inset-bottom)); border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.public-footer p { margin: 0; }
.public-footer .wordmark { font-size: 20px; }
/* Auth: one task at a time; a contrasting brand panel anchors the form. */
.auth-page { padding: 48px 20px; max-width: 1120px; margin: auto; }
.auth-layout { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.15fr); border: 1px solid #d3c8cf; border-radius: 24px; background: white; overflow: hidden; box-shadow: 0 24px 64px #4c303315; }
.auth-brand { border-radius: 0; padding: 38px; display: flex; flex-direction: column; min-height: 600px; }
.auth-brand > div:nth-child(2) { margin-top: 72px; }
.brand-eyebrow { display: block; color: #ffe5e5; font-size: 13px; margin-bottom: 10px; }
.auth-brand h2 { font-size: clamp(25px,2.6vw,36px); line-height: 1.7; }
.brand-points { display: grid; gap: 17px; font-size: 13px; margin-top: auto; }
.brand-points span { display: flex; align-items: center; gap: 12px; }
.brand-points .ui-icon { width: 20px; height: 20px; }
.auth-form-panel { padding: clamp(24px,3.8vw,48px); min-width: 0; }
.entry-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.entry-heading { font-size: 16px; margin-bottom: 20px; }
.auth-tabs { display: flex; gap: 5px; padding: 5px; background: #ede8eb; border: 1px solid #ded5da; border-radius: 12px; margin-bottom: 28px; }
.auth-tabs button { flex: 1; background: transparent; color: #62565e; border-radius: 8px; font-size: 14px; padding: 9px; }
.auth-tabs button.selected { background: white; color: var(--red); box-shadow: 0 2px 7px #3d203015; }
.auth-form-panel h2 { font-size: clamp(23px,2.3vw,29px); margin-bottom: 8px; }
.auth-intro { font-size: 14px; margin-bottom: 26px; }
.auth-form-panel .form { grid-template-columns: minmax(0,1fr); gap: 18px; }
.auth-form-panel .form > .span > .primary { width: 100%; min-height: 50px; font-size: 16px; }
.auth-options { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: -6px; }
.auth-options button { font-size: 12px; }
.mfa-option { background: #f5f2f4; border-color: #ddd3d9; font-size: 13px; }
.mfa-option summary { font-weight: 400; }
.mfa-option .field { margin: 14px 0 10px; }
.auth-bottom { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; border-top: 1px solid #e8e1e5; margin-top: 28px; padding-top: 16px; font-size: 12px; color: var(--muted); }
.auth-bottom button { font-size: 12px; }
.recovery-steps { display: grid; gap: 28px; }
.recovery-steps h3 { font-size: 16px; }
.auth { max-width: 600px; padding: 24px 20px; margin: 30px auto; }
@media (max-width: 1024px) {
  .hero-layout { gap: 24px; }
  .hero-panel { padding: 26px; }
  .search { flex-wrap: wrap; }
  .search .span { flex: 1 1 100%; }
  .search .primary { width: 100%; }
  .auth-brand { padding: 28px; }
  .shell { grid-template-columns: 210px minmax(0,1fr); }
  .nav { padding: 10px; font-size: 13px; }
}
@media (max-width: 800px) {
  .header { gap: 10px; flex-wrap: wrap; padding: 12px 20px; }
  .header-actions { gap: 8px; }
  .header .small { display: none; }
  .shell { display: block; }
  aside { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 10px 16px; }
  .workspace-label { display: none; }
  .nav { width: auto; flex: 0 0 auto; white-space: nowrap; margin: 0; }
  .grid, .three { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hero-layout { grid-template-columns: minmax(0,1fr); padding-top: 0; }
  .hero-panel { min-height: auto; padding: 28px; }
  .hero-panel .legal-mark { display: none; }
  .hero-panel h2 { margin-top: 22px; }
  .brand-caption { margin-top: 0; }
  .hero-panel .brand-rule { margin: 18px 0; }
  .feature-grid { gap: 12px; }
  .feature-card { padding: 20px; }
  .portal-section { grid-template-columns: minmax(0,1fr); }
  .auth-page { padding-top: 26px; }
  .auth-layout { grid-template-columns: minmax(0,1fr); }
  .auth-brand { min-height: auto; padding: 26px; }
  .auth-brand > div:nth-child(2) { margin-top: 20px; }
  .auth-brand h2 { font-size: 27px; margin-bottom: 8px; }
  .auth-brand h2 br { display: none; }
  .auth-brand .brand-rule, .auth-brand .brand-points, .auth-brand .brand-eyebrow { display: none; }
  .auth-brand p { max-width: 100%; font-size: 13px; }
  .auth-form-panel { padding: 28px; }
}
@media (max-width: 600px) {
  .header { padding: 12px 16px; }
  .header-actions { margin-inline-start: auto; }
  .header nav button, #install-app { font-size: 12px; padding: 9px 11px; }
  .landing { padding: 24px 16px 36px; }
  .hero-copy h1 { font-size: clamp(28px,7.8vw,40px); letter-spacing: -.7px; }
  .hero-description { font-size: 15px; }
  .hero-layout { padding-bottom: 32px; }
  .feature-grid, .grid, .three, .form { grid-template-columns: minmax(0,1fr); }
  .feature-card { padding: 23px; }
  .feature-top { margin-bottom: 14px; }
  .section-heading { display: block; }
  .portal-section { padding: 24px 18px; }
  .portal-links { grid-template-columns: minmax(0,1fr); }
  .main { padding: 20px 16px; }
  .card { padding: 20px 16px; }
  .tabs button { flex: 1 1 auto; padding: 10px; }
  .item > button { flex: 1 1 auto; }
  .auth-page { padding: 22px 16px 30px; }
  .auth-layout { border-radius: 18px; }
  .auth-form-panel { padding: 24px 20px; }
  .auth-brand { padding: 24px; }
  .auth-brand h2 { font-size: 25px; }
  .public-footer { margin-inline: 16px; padding-inline: 0; }
  .public-footer .text-button { flex-basis: 100%; }
  .bubble { max-width: 96%; padding: 13px; }
  dl { grid-template-columns: minmax(0,1fr); gap: 4px; }
  dd { margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
