/* =====================================================================
   BEAUTY DAY — Sistema visual compartilhado
   Paleta extraída da logo: ouro metálico + verde-azulado (teal)
   ===================================================================== */
@font-face { font-family: "Marcellus"; src: url("../fonts/marcellus.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-ext.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --gold-900: #B5561A;
  --gold-700: #D96B2B;
  --gold-500: #F0961E;
  --gold-300: #FCCB7E;
  --gold-100: #FBE6A6;
  --teal-700: #0E6C75;
  --teal-500: #17858D;
  --teal-300: #45B5BB;
  --metal: linear-gradient(115deg, #D96B2B 0%, #F2A65A 22%, #FCCB7E 40%, #E98A2C 62%, #FBE6A6 82%, #F0961E 100%);
  --metal-v: linear-gradient(180deg, #D96B2B 0%, #FCCB7E 30%, #E27428 52%, #FBE6A6 78%, #F0961E 100%);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --r-sm: 12px; --r: 18px; --r-lg: 26px; --r-xl: 34px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Marcellus", "Cormorant Garamond", Georgia, serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
  /* tema escuro (padrão) */
  --bg: #000000;
  --bg-glow-1: rgba(240, 150, 30, .13);
  --bg-glow-2: rgba(23, 133, 141, .12);
  --surface: #0C0C0D;
  --surface-2: #141416;
  --surface-3: #1C1C1F;
  --line: rgba(255, 244, 230, .08);
  --line-2: rgba(255, 244, 230, .14);
  --text: #F7F1EA;
  --text-2: #CFC6BC;
  --muted: #9B9289;
  --gold-text: #F5B66B;
  --teal-text: #4FC0C6;
  --good: #3CC29A; --bad: #F0705A; --warn: #F2B544;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .8), 0 2px 0 rgba(255, 255, 255, .02) inset;
  --glass: rgba(14, 14, 15, .72);
  --on-gold: #1B1006;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F8F4EE;
  --bg-glow-1: rgba(240, 150, 30, .16);
  --bg-glow-2: rgba(23, 133, 141, .12);
  --surface: #FFFFFF;
  --surface-2: #F4EEE6;
  --surface-3: #EBE3D8;
  --line: rgba(40, 24, 10, .09);
  --line-2: rgba(40, 24, 10, .16);
  --text: #1A130D;
  --text-2: #3F352C;
  --muted: #6D6258;
  --gold-text: #A9501A;
  --teal-text: #0E6C75;
  --good: #158A68; --bad: #C8462F; --warn: #A86E06;
  --shadow: 0 24px 50px -28px rgba(80, 45, 10, .35), 0 1px 0 rgba(255, 255, 255, .9) inset;
  --glass: rgba(255, 255, 255, .78);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.5; letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ambient::before, .ambient::after { content: ""; position: absolute; border-radius: 50%; filter: blur(70px); }
.ambient::before { width: 70vmax; height: 70vmax; left: 50%; top: -38vmax; transform: translateX(-50%); background: radial-gradient(circle, var(--bg-glow-1), transparent 65%); animation: drift 18s ease-in-out infinite alternate; }
.ambient::after { width: 60vmax; height: 60vmax; left: -22vmax; bottom: -30vmax; background: radial-gradient(circle, var(--bg-glow-2), transparent 65%); animation: drift 22s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(-46%, 4vmax) scale(1.08); } }

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: var(--gold-text); }
:focus-visible { outline: 2px solid var(--teal-300); outline-offset: 3px; border-radius: 10px; }
::selection { background: rgba(240, 150, 30, .35); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.display { font-family: var(--display); font-weight: 400; letter-spacing: .01em; }
.gold-text { background: var(--metal); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------------------------------- Botões */
.btn {
  --h: 48px; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 22px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font-weight: 650; font-size: 15px; letter-spacing: .01em;
  transition: transform .2s var(--ease), background .25s, border-color .25s, box-shadow .3s, opacity .2s; user-select: none; -webkit-user-select: none; overflow: hidden; white-space: nowrap;
}
.btn, a.btn { text-decoration: none; }
.btn:hover { border-color: var(--line-2); background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-gold { background: var(--metal); background-size: 180% 100%; color: var(--on-gold); border: 0; box-shadow: 0 10px 30px -10px rgba(240, 150, 30, .55), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-gold:hover { background: var(--metal); background-size: 180% 100%; background-position: 100% 0; }
.btn-gold::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); transform: translateX(-120%); }
.btn-gold:hover::after, .btn-gold.shine::after { animation: shine 1.1s var(--ease); }
@keyframes shine { to { transform: translateX(120%); } }
.btn-teal { background: var(--teal-500); color: #fff; border: 0; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--bad); }
.btn-sm { --h: 38px; padding: 0 15px; font-size: 13.5px; gap: 7px; }
.btn-lg { --h: 60px; padding: 0 32px; font-size: 17px; }
.btn-icon { width: var(--h); padding: 0; }
.btn-block { width: 100%; }
.btn .spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------- Formulários */
.field { display: grid; gap: 7px; }
.field > label, .label { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s, background .2s; font-size: 16px;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: var(--muted); opacity: .8; }
.input:focus { border-color: var(--gold-500); box-shadow: 0 0 0 4px rgba(240, 150, 30, .14); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 52px; }
.input-wrap .suffix { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.hint { font-size: 12.5px; color: var(--muted); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 48px; height: 28px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background .25s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-2); transition: transform .3s var(--ease-spring), background .25s; }
.switch input:checked + .track { background: var(--gold-500); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(20px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--teal-300); outline-offset: 2px; }
.switch.teal input:checked + .track { background: var(--teal-500); }

/* --------------------------------------------------------- Cartões e chips */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .02em; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.chip-bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.chip-warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.chip-teal { background: color-mix(in srgb, var(--teal-500) 20%, transparent); color: var(--teal-text); }
.chip-gold { background: color-mix(in srgb, var(--gold-500) 18%, transparent); color: var(--gold-text); }
.band-excelente { color: var(--good); } .band-muito-bom { color: var(--teal-text); } .band-bom { color: var(--gold-text); } .band-melhorar { color: var(--bad); }

/* --------------------------------------------------------- Avatar */
.avatar { position: relative; border-radius: 50%; overflow: hidden; background: var(--surface-3); flex: none; display: grid; place-items: center; font-family: var(--display); color: var(--gold-text); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.ring { padding: 3px; border-radius: 50%; background: var(--metal); flex: none; }
.ring > .avatar { border: 3px solid var(--bg); }

/* --------------------------------------------------------- Toast */
.toasts { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); z-index: 9999; display: grid; gap: 10px; width: min(92vw, 420px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 16px; background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border: 1px solid var(--line-2); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .6); font-weight: 600; font-size: 14px; animation: toastIn .45s var(--ease-spring) both; pointer-events: auto; }
.toast.out { animation: toastOut .3s var(--ease) both; }
.toast .icon { color: var(--gold-text); }
.toast.error .icon { color: var(--bad); }
.toast.ok .icon { color: var(--good); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* --------------------------------------------------------- Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(0, 0, 0, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fadeIn .25s var(--ease) both; overflow-y: auto; }
.modal { width: min(100%, 560px); max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .8); animation: modalIn .45s var(--ease-spring) both; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px 6px; }
.modal-head h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 24px; }
.modal-body { padding: 14px 24px 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 24px; flex-wrap: wrap; }
.modal-backdrop.closing { animation: fadeOut .22s var(--ease) both; }
.modal-backdrop.closing .modal { animation: modalOut .22s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.96); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(12px) scale(.97); } }
@media (max-width: 600px) {
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { width: 100%; border-radius: 28px 28px 0 0; max-height: 94dvh; padding-bottom: var(--safe-b); animation-name: sheetIn; }
  .modal-backdrop.closing .modal { animation-name: sheetOut; }
  @keyframes sheetIn { from { transform: translateY(100%); } }
  @keyframes sheetOut { to { transform: translateY(100%); } }
}

/* --------------------------------------------------------- Skeleton */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sk 1.4s linear infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

/* --------------------------------------------------------- Status de conexão */
.net { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--text-2); transition: all .35s var(--ease); white-space: nowrap; }
.net .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); animation: pulse 2.4s infinite; }
.net.offline { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.net.offline .pulse { background: var(--warn); }
.net.syncing .pulse { background: var(--teal-300); animation: pulse .9s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
:root[data-theme="light"] .gold-text { background: linear-gradient(115deg, #A9501A 0%, #D96B2B 45%, #B5561A 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
