/* ARON — l'universo di AR Agency. Palette e caratteri del brand: nero inchiostro, oro, crema. */
:root {
  --ink: #0B0A08; --ink-2: #12100C; --ink-3: #1A1712;
  --gold: #D4AF5A; --gold-2: #F0D58C; --gold-deep: #8C6A2A; --on-gold: #16120A;
  --cream: #F3EBDB; --text: #D9CFBD; --muted: #A39680; --faint: #6E6556;
  --line: rgba(212,175,90,.28); --line-soft: rgba(243,235,219,.09);
  --good: #8FD1B0; --warn: #E8C36A; --bad: #EE9466;
  --gold-grad: linear-gradient(100deg, #F0D58C, #D4AF5A 45%, #B8893A);
  --f-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --f-body: 'Manrope', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--text); font-family: var(--f-body); font-size: 16px; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
b, strong { color: var(--cream); font-weight: 600; }

#space { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- ingresso ---------- */
#intro { position: fixed; inset: 0; z-index: 40; background: var(--ink); display: grid; place-items: center; transition: opacity 1.4s ease, transform 1.6s cubic-bezier(.2,.7,0,1); }
#intro.open { opacity: 0; transform: scale(1.25); pointer-events: none; }
.ring { position: absolute; width: min(64vmin, 520px); height: min(64vmin, 520px); }
.ring circle { fill: none; stroke: url(#goldStroke); stroke-width: 1.4; stroke-dasharray: 580; stroke-dashoffset: 580; animation: draw 2.2s cubic-bezier(.6,0,.2,1) forwards; transform-origin: center; transform: rotate(-90deg); }
.ring .inner { stroke-width: .6; opacity: .6; stroke-dasharray: 545; stroke-dashoffset: 545; animation-delay: .35s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.intro-text { position: relative; text-align: center; }
.intro-name { font-family: var(--f-display); font-weight: 500; font-size: clamp(56px, 11vmin, 104px); letter-spacing: .32em; padding-left: .32em; line-height: 1; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: 0; animation: rise 1.4s .9s ease forwards; }
.intro-line { width: 0; height: 1px; margin: 22px auto 16px; background: var(--gold-grad); animation: grow 1.2s 1.6s ease forwards; }
@keyframes grow { to { width: min(46vmin, 300px); } }
.intro-sub { font-size: 11px; letter-spacing: .5em; padding-left: .5em; color: var(--cream); opacity: 0; animation: rise 1.2s 1.9s ease forwards; }
.intro-welcome { margin-top: 26px; min-height: 1.4em; font-family: var(--f-display); font-style: italic; font-size: clamp(20px, 3.2vmin, 28px); color: var(--gold-2); opacity: 0; transition: opacity 1s; }
.intro-welcome.on { opacity: 1; }
.intro-welcome.err { color: var(--bad); font-style: normal; font-family: var(--f-body); font-size: 14px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- HUD in basso ---------- */
.hud { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; padding: 70px 24px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(11,10,8,.97) 0%, rgba(11,10,8,.88) 55%, rgba(11,10,8,0) 100%); pointer-events: none; }
.hud > * { pointer-events: auto; }

.reply { width: min(780px, 100%); margin-bottom: 14px; text-align: left; transition: opacity .4s; }
.reply-who { font-family: var(--f-display); font-style: italic; font-size: 18px; color: var(--gold); margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.reply-who::after { content: ''; flex: 0 0 48px; height: 1px; background: var(--line); }
.thinking .reply-who { color: var(--gold-2); }
.thinking .reply-who::after { background: var(--gold-grad); animation: breathe 1.2s infinite; }
@keyframes breathe { 50% { opacity: .3; } }
.reply-body { max-height: 26vh; overflow-y: auto; font-size: 16.5px; line-height: 1.65; font-weight: 300; color: var(--text); scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.reply-body p { margin: 0 0 8px; } .reply-body p:last-child { margin: 0; }
.reply-body ul { margin: 4px 0 8px; padding-left: 20px; }
.reply-body li::marker { color: var(--gold); }
.reply-body code { color: var(--gold-2); font-size: 14px; }
.reply-body.typing { white-space: pre-wrap; }
.reply-body.caret::after { content: ''; display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--gold); animation: breathe .9s infinite; }
.reply-body .asked { color: var(--muted); font-style: italic; }
.reply-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.reply-acts:empty { display: none; }
.act { font-size: 11px; letter-spacing: .08em; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line-soft); color: var(--muted); }
.act.OK { border-color: rgba(212,175,90,.45); color: var(--gold-2); }
.act.AWAITING_OWNER_AUTHORIZATION { border-color: rgba(232,195,106,.6); color: var(--warn); }
.act.ERROR, .act.NOT_ENABLED { border-color: rgba(238,148,102,.5); color: var(--bad); }

.notice { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 7px 8px 7px 14px; border-radius: 99px; border: 1px solid rgba(212,175,90,.5); background: rgba(212,175,90,.08); font-size: 13px; color: var(--cream); cursor: pointer; animation: glow 3s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 24px rgba(212,175,90,.25); } }
.notice-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 10px var(--gold); }
.notice-go { background: var(--gold-grad); color: var(--on-gold); font-weight: 600; font-size: 12px; padding: 4px 12px; border-radius: 99px; }

.suggest { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 12px; max-width: 780px; transition: opacity .3s; }
.suggest button { background: rgba(243,235,219,.03); border: 1px solid var(--line-soft); color: var(--muted); padding: 6px 14px; border-radius: 99px; font-size: 13px; cursor: pointer; transition: all .2s; }
.suggest button:hover { color: var(--gold-2); border-color: var(--line); }

.composer { width: min(780px, 100%); display: flex; align-items: flex-end; gap: 8px; padding: 7px 7px 7px 22px; border-radius: 28px; background: rgba(18,16,12,.86); border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(240,213,140,.04) inset; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: rgba(212,175,90,.6); box-shadow: 0 10px 40px rgba(0,0,0,.5), 0 0 30px rgba(212,175,90,.12); }
.composer textarea { flex: 1; resize: none; background: transparent; border: 0; outline: none; color: var(--cream); font: 300 16px/1.5 var(--f-body); padding: 9px 0; min-height: 26px; max-height: 140px; }
.composer textarea::placeholder { color: var(--faint); }
.round { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; transition: transform .15s, opacity .2s; }
.round svg { width: 20px; height: 20px; }
.mic { background: transparent; border: 1px solid var(--line-soft); color: var(--faint); cursor: not-allowed; }
.send { border: 0; background: var(--gold-grad); color: var(--on-gold); box-shadow: 0 0 18px rgba(212,175,90,.35); }
.send:hover { transform: scale(1.05); }
.send:disabled { opacity: .35; box-shadow: none; cursor: default; transform: none; }

.bar { width: min(1180px, 100%); display: flex; align-items: center; gap: 18px; margin-top: 14px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
.mark { display: flex; align-items: center; gap: 10px; }
.mark-name { font-family: var(--f-display); font-size: 17px; letter-spacing: .28em; text-transform: none; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 600; }
.mark-sep { width: 18px; height: 1px; background: var(--line); }
.nav { display: flex; gap: 4px; margin: 0 auto; }
.nav button { background: none; border: 0; padding: 6px 10px; color: var(--muted); letter-spacing: .18em; text-transform: uppercase; font-size: 11px; cursor: pointer; transition: color .2s; }
.nav button:hover { color: var(--gold-2); }
.count { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 6px; border-radius: 99px; background: var(--gold); color: var(--on-gold); font-size: 10px; letter-spacing: 0; font-weight: 700; }
.status { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.sdot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.sdot.on { background: var(--gold-2); box-shadow: 0 0 8px var(--gold); }
.sdot.warn { background: var(--bad); }

/* ---------- moduli ---------- */
.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(5,4,3,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: relative; width: min(1000px, 100%); max-height: 82vh; display: flex; flex-direction: column; padding: 30px 36px 0; border-radius: 22px 22px 0 0; background: linear-gradient(180deg, rgba(26,23,18,.97), rgba(11,10,8,.98)); border: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -20px 80px rgba(0,0,0,.6); animation: up .45s cubic-bezier(.2,.8,0,1); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.close { position: absolute; top: 18px; right: 18px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-soft); background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.close svg { width: 18px; height: 18px; }
.close:hover { color: var(--gold-2); border-color: var(--line); }
.eyebrow { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.sheet h2 { margin: 6px 0 4px; font-family: var(--f-display); font-weight: 500; font-size: clamp(32px, 4vw, 44px); color: var(--cream); }
.lead { margin: 0 0 18px; color: var(--muted); font-weight: 300; max-width: 62ch; line-height: 1.55; }
.sheet-body { overflow-y: auto; padding-bottom: 36px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.card { position: relative; padding: 18px 20px; border-radius: 16px; background: rgba(255,236,200,.035); border: 1px solid var(--line-soft); line-height: 1.55; margin-bottom: 12px; font-weight: 300; }
.grid .card { margin-bottom: 0; }
.card h4 { margin: 0 0 4px; font-family: var(--f-display); font-weight: 600; font-size: 22px; color: var(--cream); }
.meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.pill { display: inline-block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line-soft); color: var(--muted); margin: 0 6px 0 0; vertical-align: middle; font-family: var(--f-body); font-weight: 500; }
.pill.ACTIVE, .pill.APPROVED, .pill.DONE { color: var(--gold-2); border-color: var(--line); }
.pill.PENDING, .pill.auth, .pill.MODIFICATION_REQUESTED { color: var(--warn); border-color: rgba(232,195,106,.5); }
.pill.REJECTED, .pill.FAILED, .pill.BLOCKED { color: var(--bad); border-color: rgba(238,148,102,.45); }
.steps { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; padding: 10px 0 10px 40px; border-top: 1px solid var(--line-soft); position: relative; }
.steps li::before { content: counter(s, upper-roman); position: absolute; left: 0; top: 9px; font-family: var(--f-display); font-style: italic; font-size: 19px; color: var(--gold); }
.section-h { margin: 26px 0 12px; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.apr { border-color: rgba(212,175,90,.45); background: linear-gradient(135deg, rgba(212,175,90,.10), rgba(212,175,90,.02)); }
.apr .why { color: var(--cream); font-weight: 400; }
.btns { display: flex; gap: 8px; margin-top: 14px; }
.btns button { flex: 1; padding: 10px 0; border-radius: 99px; border: 1px solid var(--line-soft); background: none; cursor: pointer; font-size: 13px; letter-spacing: .06em; transition: all .2s; }
.btns .yes { background: var(--gold-grad); color: var(--on-gold); border: 0; font-weight: 600; }
.btns .no { color: var(--bad); border-color: rgba(238,148,102,.4); }
.btns button:hover { filter: brightness(1.1); }
.msg { margin-bottom: 18px; line-height: 1.6; font-weight: 300; }
.msg .who { font-family: var(--f-display); font-style: italic; color: var(--gold); margin-bottom: 2px; }
.msg.owner .who { color: var(--muted); }
.msg.owner .body { color: var(--cream); }
.msg .body p { margin: 0 0 6px; }
.muted { color: var(--muted); }

/* ---------- telefono ---------- */
@media (max-width: 860px) {
  .hud { padding: 50px 14px calc(10px + env(safe-area-inset-bottom)); }
  .reply-body { max-height: 30vh; font-size: 15.5px; }
  .bar { flex-wrap: wrap; justify-content: space-between; gap: 6px 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; justify-content: space-between; margin: 0; scrollbar-width: none; }
  .nav button { padding: 6px 6px; letter-spacing: .1em; white-space: nowrap; }
  .suggest { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; width: 100%; scrollbar-width: none; }
  .suggest button { white-space: nowrap; }
  .sheet { padding: 24px 18px 0; max-height: 88vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
