:root {
  color-scheme: dark;
  --ap-bg: #070b12;
  --ap-panel: rgba(17, 25, 38, .94);
  --ap-panel-2: rgba(27, 37, 54, .8);
  --ap-line: rgba(255, 255, 255, .12);
  --ap-text: #f8fafc;
  --ap-muted: #a9b4c5;
  --ap-red: #e11d3f;
  --ap-red-dark: #9f0c24;
  --ap-green: #36df9d;
  --ap-blue: #60a5fa;
  --ap-shadow: 0 26px 80px rgba(0, 0, 0, .42);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--ap-bg); }
body.apv180-page {
  min-height: 100vh;
  margin: 0;
  color: var(--ap-text);
  background:
    radial-gradient(circle at 10% -10%, rgba(225, 29, 63, .3), transparent 32rem),
    radial-gradient(circle at 100% 35%, rgba(37, 99, 235, .15), transparent 34rem),
    linear-gradient(160deg, #080b12 0%, #0b1220 58%, #070a10 100%);
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.apv180-shell { width: min(920px, 100%); margin: 0 auto; padding: 18px 18px 44px; }
.apv180-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.apv180-brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.apv180-brand-mark {
  width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px;
  background: linear-gradient(145deg, #ef2a4b, #970b20); box-shadow: 0 10px 28px rgba(225, 29, 63, .3);
  font-weight: 1000; letter-spacing: -.04em;
}
.apv180-brand b, .apv180-brand small { display: block; }
.apv180-brand b { font-size: 15px; letter-spacing: -.01em; }
.apv180-brand small { margin-top: 2px; color: var(--ap-muted); font-size: 11px; font-weight: 700; }
.apv180-mode { padding: 8px 11px; border: 1px solid var(--ap-line); border-radius: 999px; color: #dce5f2; background: rgba(255,255,255,.05); font-size: 11px; font-weight: 900; }

.apv180-hero {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 20px;
  padding: 25px; margin-bottom: 16px; overflow: hidden; position: relative;
  border: 1px solid rgba(244, 63, 94, .3); border-radius: 28px;
  background: linear-gradient(130deg, rgba(120, 8, 31, .92), rgba(48, 9, 21, .82));
  box-shadow: var(--ap-shadow);
}
.apv180-hero::after { content: ""; position: absolute; inset: auto -80px -100px auto; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.06); }
.apv180-siren {
  width: 72px; height: 72px; display: grid; place-items: center; position: relative; z-index: 1;
  border: 2px solid rgba(255,255,255,.35); border-radius: 24px; background: linear-gradient(145deg, #ff3358, #a80e27);
  box-shadow: 0 0 0 9px rgba(255,255,255,.05), 0 18px 38px rgba(0,0,0,.35); font-size: 40px; font-weight: 1000;
}
.apv180-eyebrow { margin: 0 0 7px; color: #ffbac7; font-size: 11px; font-weight: 1000; letter-spacing: .14em; text-transform: uppercase; }
.apv180-hero h1 { max-width: 680px; margin: 0; font-size: clamp(27px, 5vw, 45px); line-height: 1.02; letter-spacing: -.045em; }
.apv180-hero p:last-child { max-width: 690px; margin: 13px 0 0; color: #f4cbd3; font-size: 14px; line-height: 1.55; }

.apv180-card { padding: 24px; border: 1px solid var(--ap-line); border-radius: 28px; background: var(--ap-panel); box-shadow: var(--ap-shadow); backdrop-filter: blur(18px); }
.apv180-card-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.apv180-card-head span { color: var(--ap-muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.apv180-card-head h2 { margin: 4px 0 0; font-size: clamp(22px, 4vw, 31px); letter-spacing: -.035em; }
.apv180-card-head > strong { padding: 8px 12px; color: #ffdce3; border: 1px solid rgba(244,63,94,.4); border-radius: 999px; background: rgba(225,29,63,.16); font-size: 11px; letter-spacing: .08em; }

.apv180-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.apv180-grid .wide { grid-column: 1 / -1; }
.apv180-field { display: flex; flex-direction: column; min-width: 0; gap: 7px; }
.apv180-field > span { color: #dbe3ee; font-size: 12px; font-weight: 900; }
.apv180-field em { color: var(--ap-muted); font-style: normal; font-weight: 700; }
.apv180-field input, .apv180-field select, .apv180-field textarea {
  width: 100%; border: 1px solid var(--ap-line); border-radius: 16px; outline: 0; background: rgba(255,255,255,.055); color: var(--ap-text); padding: 14px 15px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.apv180-field textarea { resize: vertical; min-height: 122px; line-height: 1.48; }
.apv180-field select { color-scheme: dark; }
.apv180-field input::placeholder, .apv180-field textarea::placeholder { color: #738096; }
.apv180-field input:focus, .apv180-field select:focus, .apv180-field textarea:focus { border-color: rgba(96,165,250,.72); background: rgba(96,165,250,.065); box-shadow: 0 0 0 4px rgba(59,130,246,.12); }
.field-error { min-height: 15px; color: #ff8fa3; font-size: 11px; font-weight: 800; }
.apv180-field.error input, .apv180-field.error select, .apv180-field.error textarea, .apv180-upload.error, .apv180-consent.error { border-color: rgba(251, 113, 133, .8); box-shadow: 0 0 0 4px rgba(225,29,63,.1); }

.apv180-location { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 51px; padding: 12px; border: 1px dashed rgba(96,165,250,.48); border-radius: 16px; color: #cce3ff; background: rgba(59,130,246,.08); cursor: pointer; font-weight: 900; }
.apv180-location:hover { background: rgba(59,130,246,.14); }
.apv180-location.ready { color: #c9ffe8; border-color: rgba(54,223,157,.5); background: rgba(54,223,157,.1); }

.apv180-upload { min-height: 88px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 15px; border: 1px dashed rgba(255,255,255,.22); border-radius: 19px; background: rgba(255,255,255,.035); cursor: pointer; }
.apv180-upload:hover { border-color: rgba(96,165,250,.5); background: rgba(96,165,250,.06); }
.apv180-upload > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.apv180-upload-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: rgba(96,165,250,.13); color: #9cc8ff; font-size: 25px; }
.apv180-upload b, .apv180-upload small { display: block; }
.apv180-upload b { font-size: 13px; }
.apv180-upload small { margin-top: 4px; color: var(--ap-muted); font-size: 11px; }
.apv180-upload > strong { padding: 9px 11px; border: 1px solid var(--ap-line); border-radius: 999px; font-size: 11px; }
.apv180-upload > .field-error { grid-column: 2 / -1; }
.apv180-files { display: flex; flex-wrap: wrap; gap: 7px; margin-top: -6px; }
.apv180-files span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 7px 9px; border: 1px solid var(--ap-line); border-radius: 999px; color: #c7d2e1; background: rgba(255,255,255,.04); font-size: 10px; }

.apv180-consent { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; margin: 4px 0; padding: 13px; border: 1px solid transparent; border-radius: 16px; color: #bdc7d6; font-size: 12px; line-height: 1.45; }
.apv180-consent input { width: 19px; height: 19px; accent-color: var(--ap-red); }
.apv180-consent a { color: #9fc8ff; }
.apv180-consent .field-error { grid-column: 2; }
.apv180-submit { width: 100%; min-height: 57px; display: flex; align-items: center; justify-content: center; margin-top: 17px; padding: 15px 20px; border: 0; border-radius: 18px; color: white; background: linear-gradient(135deg, #ef294c, #ae0c28); box-shadow: 0 15px 36px rgba(225,29,63,.28); cursor: pointer; font-weight: 1000; letter-spacing: -.01em; }
.apv180-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.apv180-submit:disabled { opacity: .65; cursor: wait; transform: none; }
.apv180-submit.link { text-decoration: none; }
.apv180-safe-note { margin: 11px auto 0; color: #8290a4; text-align: center; font-size: 10px; line-height: 1.4; }
.apv180-safe-note-left { margin: 0; text-align: left; }

.apv180-alert { margin: 0 0 14px; padding: 13px 15px; border: 1px solid rgba(96,165,250,.3); border-radius: 16px; color: #dbeafe; background: rgba(37,99,235,.13); font-size: 13px; font-weight: 800; }
.apv180-alert.error { color: #ffdbe2; border-color: rgba(244,63,94,.4); background: rgba(159,12,36,.25); }
.apv180-success { text-align: center; }
.apv180-success-icon { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 22px; color: #06140e; background: var(--ap-green); box-shadow: 0 14px 35px rgba(54,223,157,.24); font-size: 35px; font-weight: 1000; }
.apv180-success h2 { margin: 3px 0 12px; font-size: clamp(26px, 5vw, 39px); letter-spacing: -.04em; }
.apv180-success p { color: #bac5d4; }
.apv180-success strong { color: white; }
.apv180-coverage { margin: 17px 0; padding: 15px; border: 1px solid rgba(245,158,11,.35); border-radius: 16px; color: #ffe6ad; background: rgba(245,158,11,.1); line-height: 1.45; }
.apv180-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 18px; color: #7f8ca0; font-size: 10px; line-height: 1.45; }
.apv180-footer a { color: #b9c6d8; text-decoration: none; font-weight: 900; }
.apv180-footer span { max-width: 520px; text-align: right; }

/* Chat pratica */
.apv180-chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 15px; align-items: start; }
.apv180-chat-main { min-width: 0; }
.apv180-practice-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.apv180-practice-head h1 { margin: 3px 0 0; font-size: clamp(24px, 5vw, 38px); letter-spacing: -.04em; }
.apv180-status { flex: 0 0 auto; padding: 8px 10px; border: 1px solid rgba(244,63,94,.35); border-radius: 999px; color: #ffb5c3; background: rgba(225,29,63,.12); font-size: 10px; font-weight: 1000; text-transform: uppercase; }
.apv180-message-list { height: min(58vh, 620px); min-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 13px; border: 1px solid var(--ap-line); border-radius: 20px; background: rgba(3,7,14,.55); scroll-behavior: smooth; }
.apv180-message { max-width: 84%; align-self: flex-start; padding: 11px 13px; border: 1px solid var(--ap-line); border-radius: 6px 17px 17px 17px; background: var(--ap-panel-2); }
.apv180-message.mine { align-self: flex-end; border-color: rgba(59,130,246,.28); border-radius: 17px 6px 17px 17px; background: rgba(37,99,235,.25); }
.apv180-message.system { align-self: center; max-width: 96%; border-color: rgba(245,158,11,.22); border-radius: 15px; background: rgba(245,158,11,.08); color: #fce4ae; text-align: center; }
.apv180-message-head { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 5px; color: #91a0b5; font-size: 9px; }
.apv180-message-head b { color: #dce5f2; font-size: 10px; }
.apv180-message-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.45; }
.apv180-attachment-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.apv180-attachment { max-width: 100%; padding: 7px 9px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; color: #dbeafe; background: rgba(255,255,255,.055); cursor: pointer; font-size: 10px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apv180-composer { margin-top: 10px; }
.apv180-composer textarea { width: 100%; min-height: 84px; resize: vertical; padding: 13px; border: 1px solid var(--ap-line); border-radius: 16px; outline: 0; color: white; background: rgba(255,255,255,.05); }
.apv180-composer textarea:focus { border-color: rgba(96,165,250,.6); box-shadow: 0 0 0 4px rgba(59,130,246,.1); }
.apv180-composer-actions { display: flex; gap: 8px; margin-top: 8px; }
.apv180-composer-actions .apv180-submit { margin: 0; min-height: 46px; }
.apv180-file-button { flex: 0 0 auto; width: 50px; display: grid; place-items: center; border: 1px solid var(--ap-line); border-radius: 15px; background: rgba(255,255,255,.06); cursor: pointer; font-size: 22px; }
.apv180-file-button input { position: absolute; opacity: 0; pointer-events: none; }
.apv180-side { display: grid; gap: 12px; }
.apv180-info-card { padding: 17px; border: 1px solid var(--ap-line); border-radius: 21px; background: var(--ap-panel); }
.apv180-info-card h2 { margin: 0 0 12px; font-size: 15px; }
.apv180-info-row { margin-top: 10px; }
.apv180-info-row span, .apv180-info-row b { display: block; }
.apv180-info-row span { color: var(--ap-muted); font-size: 9px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.apv180-info-row b { margin-top: 3px; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.apv180-compact-button { width: 100%; margin-top: 12px; padding: 11px; border: 1px solid rgba(245,158,11,.35); border-radius: 13px; color: #ffe3a0; background: rgba(245,158,11,.09); cursor: pointer; font-weight: 900; }
.apv180-request-files { display: grid; gap: 6px; }
.apv180-empty { display: grid; place-items: center; flex: 1; min-height: 200px; color: #77859a; text-align: center; font-size: 12px; }

@media (max-width: 760px) {
  .apv180-shell { padding: 12px 12px 34px; }
  .apv180-topbar { margin-bottom: 15px; }
  .apv180-mode { max-width: 145px; text-align: center; }
  .apv180-hero { grid-template-columns: 1fr; padding: 20px; border-radius: 23px; }
  .apv180-siren { width: 54px; height: 54px; border-radius: 17px; font-size: 30px; }
  .apv180-card { padding: 17px; border-radius: 22px; }
  .apv180-grid { grid-template-columns: 1fr; }
  .apv180-grid .wide { grid-column: auto; }
  .apv180-upload { grid-template-columns: auto 1fr; }
  .apv180-upload > strong { grid-column: 2; width: fit-content; }
  .apv180-upload > .field-error { grid-column: 2; }
  .apv180-footer { flex-direction: column; }
  .apv180-footer span { text-align: left; }
  .apv180-chat-layout { grid-template-columns: 1fr; }
  .apv180-side { grid-template-columns: 1fr; }
  .apv180-message-list { height: 52vh; min-height: 330px; }
  .apv180-message { max-width: 91%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
