/* Mandala Shot - Brand BRILIA 2.0 (Deep Sage + Amber Gold) */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --bg: #f8f6f2;            /* warm white */
  --card: #ffffff;
  --line: #e7e1d6;
  --indigo: #2a6350;       /* sage primario (azioni) */
  --indigo-700: #1f4d3d;   /* sage scuro (hover) */
  --teal: #65a88d;         /* sage medio */
  --sand: #d88a4d;         /* amber accento */
  --amber-soft: #f0b274;   /* pastel orange */
  --tint: #e4efe9;         /* sage chiaro (stati "on") */
  --tint-line: #cfe2d7;
  --danger: #b3261e;
  --ok: #2f7d5f;
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(31, 77, 61, 0.10);
  --maxw: 720px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 64px; }
.wrap--wide { max-width: 980px; }

/* Header / brand */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand__mark {
  width: 40px; height: 40px; flex: 0 0 40px;
  background: url('/assets/logo-brilia.png') center / contain no-repeat;
}
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; letter-spacing: .2px; line-height: 1; }
.brand__name small { display: block; font-family: var(--font-body); font-weight: 500; color: var(--ink-soft); font-size: .74rem; letter-spacing: .4px; text-transform: uppercase; margin-top: 3px; }

.user-chip { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--ink-soft); }

/* Card */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px;
}
.card + .card { margin-top: 20px; }

h1 { font-family: var(--font-display); font-weight: 600; font-size: 2rem; margin: 0 0 6px; letter-spacing: .2px; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; margin: 0 0 12px; }
.lead { color: var(--ink-soft); margin: 0 0 22px; }

/* Form */
label { display: block; font-weight: 600; font-size: .92rem; margin: 16px 0 6px; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: .82rem; }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
textarea { min-height: 130px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }

.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row > .col { flex: 1 1 200px; }

/* Pills / segmented */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: .9rem; user-select: none;
}
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill--on { border-color: var(--indigo); color: var(--indigo-700); background: var(--tint); font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--indigo); color: #fff; border: 0; border-radius: 10px;
  padding: 12px 20px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--indigo-700); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--indigo-700); border: 1px solid var(--indigo); }
.btn--ghost:hover { background: var(--tint); }
.btn--sm { padding: 7px 12px; font-size: .85rem; }
.btn--ok { background: var(--ok); }
.btn--danger { background: var(--danger); }

/* Tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 14px; cursor: pointer; color: var(--ink-soft); border-bottom: 2px solid transparent; }
.tab--on { color: var(--indigo-700); border-bottom-color: var(--indigo); font-weight: 600; }

/* Output */
.output { margin-top: 22px; display: none; }
.output--on { display: block; }
.summary { background: var(--tint); border: 1px solid var(--tint-line); border-radius: 10px; padding: 14px 16px; color: var(--ink); }
.promptbox {
  position: relative; margin-top: 14px; background: #163829; color: #f0ede7;
  border-radius: 10px; padding: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86rem; white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: .78rem; color: var(--ink-soft); }

/* Messages */
.msg { padding: 11px 14px; border-radius: 10px; margin: 14px 0; font-size: .92rem; display: none; }
.msg--on { display: block; }
.msg--err { background: #fdeceb; color: var(--danger); border: 1px solid #f3c6c3; }
.msg--ok { background: #e7f2ec; color: var(--ok); border: 1px solid #c4e6d1; }

/* Spinner */
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Table (admin) */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink-soft); font-weight: 600; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; }
.badge--pending { background: #fbeacf; color: #8a5a1e; }
.badge--approved { background: #e7f2ec; color: var(--ok); }
.badge--rejected { background: #fdeceb; color: var(--danger); }

.center { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.muted { color: var(--ink-soft); font-size: .9rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
