/* SHINNARE · Portal — base: cores, tipografia, botões e formulários.
   Tema claro com dourado da marca (referência: painel de trabalho "Vamos transformar novas oportunidades?"). */

:root {
  --bg: #f5f2eb;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --surface-3: #f1ede4;
  --line: #e9e3d6;
  --line-2: #dcd3c1;
  --ink: #16120c;
  --text: #2b251c;
  --muted: #6f6656;
  --faint: #9d9482;
  --gold: #c38f28;
  --gold-2: #e0b24a;
  --gold-3: #f4d98c;
  --gold-soft: #fbf1d5;
  --gold-ink: #7a5611;
  --grad-gold: linear-gradient(135deg, #f8e3a0 0%, #e3b650 38%, #c28a2a 72%, #efcd75 100%);
  --ok: #1c7a45; --ok-soft: #e2f3e8;
  --warn: #9a6205; --warn-soft: #fcefd2;
  --bad: #b1261f; --bad-soft: #fbe4e1;
  --info: #22569f; --info-soft: #e4edfa;
  --muted-soft: #eeeae2;
  --radius: 16px;
  --radius-sm: 11px;
  --radius-xs: 8px;
  --shadow-1: 0 1px 2px rgba(22, 18, 12, .05);
  --shadow-2: 0 1px 2px rgba(22, 18, 12, .04), 0 10px 28px -14px rgba(22, 18, 12, .18);
  --shadow-3: 0 24px 60px -20px rgba(22, 18, 12, .35);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --side-w: 256px;
  /* áreas seguras do app instalado (barra de status, recorte da câmera, barra de gestos) */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --top-bar: 64px;
  --top-h: calc(var(--top-bar) + var(--safe-t));
  --ease: cubic-bezier(.2, .7, .2, 1);
  --focus: 0 0 0 3px rgba(195, 143, 40, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--gold-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
p { margin: 0 0 .8em; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
hr.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: var(--gold-3); color: var(--ink); }
[hidden] { display: none !important; }
.ic { flex: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 300; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
.center { text-align: center; }
.pad { padding: 20px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.gold-text { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kicker { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-ink); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- carregamento ---------- */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(circle at 50% 45%, #1c160b, #070605 70%); }
.boot img { filter: drop-shadow(0 0 22px rgba(224, 178, 74, .45)); }
.spin { display: inline-block; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(195, 143, 40, .25); border-top-color: var(--gold); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 40vh; color: var(--muted); }
.skeleton { display: grid; gap: 12px; padding: 4px 0; }
.skeleton span { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--surface-3), #f8f5ee, var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton span, .spin { animation-duration: 3s; } * { scroll-behavior: auto !important; } }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px;
  font-weight: 650; font-size: 14.5px; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .spin { width: 16px; height: 16px; border-width: 2px; border-color: currentColor; border-top-color: transparent; opacity: .8; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2d251a; box-shadow: 0 8px 20px -10px rgba(22, 18, 12, .6); }
.btn-gold { background: var(--grad-gold); color: #1a1206; box-shadow: 0 8px 22px -12px rgba(195, 143, 40, .9), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-gold:hover:not(:disabled) { filter: brightness(1.04); box-shadow: 0 12px 26px -12px rgba(195, 143, 40, 1), inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn-subtle { background: var(--surface); border-color: var(--line-2); color: var(--text); }
.btn-subtle:hover:not(:disabled) { border-color: var(--gold); color: var(--ink); background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #93201a; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover:not(:disabled) { background: #156339; }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--gold-ink); text-decoration: underline; text-underline-offset: 3px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-block { display: flex; width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold-ink); font-weight: 600; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none; border-radius: 11px; border: 1px solid transparent; background: transparent; color: var(--text);
  transition: background-color .2s, border-color .2s, color .2s;
}
.icon-btn-sm { width: 32px; height: 32px; border-radius: 9px; }
.icon-btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }
.icon-btn-subtle { background: var(--surface); border-color: var(--line-2); }
.icon-btn-subtle:hover:not(:disabled) { border-color: var(--gold); }
.icon-btn-danger:hover:not(:disabled) { background: var(--bad-soft); color: var(--bad); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-badge { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }

/* ---------- selos (badges) ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; line-height: 1.4; white-space: nowrap; }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.tone-ok { background: var(--ok-soft); color: var(--ok); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-bad { background: var(--bad-soft); color: var(--bad); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-gold { background: var(--gold-soft); color: var(--gold-ink); }
.tone-muted { background: var(--muted-soft); color: var(--muted); }
.tone-default { background: var(--surface-3); color: var(--ink); }

/* ---------- formulários ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2, .form-grid .field:has(textarea) { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13.5px; font-weight: 650; color: var(--ink); }
.req { color: var(--bad); }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.field-error, .form-error { margin: 0; font-size: 13px; color: var(--bad); font-weight: 600; }
.form-error { padding: 10px 14px; border-radius: 10px; background: var(--bad-soft); margin-bottom: 14px; }
.input {
  width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid var(--line-2); border-radius: 11px;
  background: var(--surface); color: var(--ink); font-size: 15px; transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: #cbbfa7; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus); }
.input:disabled { background: var(--surface-3); color: var(--muted); }
.has-error .input, .input[aria-invalid="true"] { border-color: var(--bad); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 38px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236f6656' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") right 13px center / 16px no-repeat; }
.input-affix { display: flex; align-items: stretch; }
.input-affix > span { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-right: 0; border-radius: 11px 0 0 11px; background: var(--surface-3); color: var(--muted); font-weight: 600; font-size: 14px; }
.input-affix .input { border-radius: 0 11px 11px 0; }
input[type="date"].input, input[type="datetime-local"].input { min-height: 44px; }

.check, .switch { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14.5px; color: var(--text); user-select: none; }
.check input, .switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border: 1.5px solid var(--line-2); border-radius: 7px; background: var(--surface); color: transparent; transition: .15s; margin-top: 1px; }
.check input:checked + .check-box { background: var(--ink); border-color: var(--ink); color: #fff; }
.check input:focus-visible + .check-box, .switch input:focus-visible + .switch-track { box-shadow: var(--focus); }
.check-label small { display: block; color: var(--muted); font-size: 12.5px; }
.switch-track { width: 42px; height: 24px; flex: none; border-radius: 12px; background: var(--line-2); position: relative; transition: background-color .2s; }
.switch-track span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch input:checked + .switch-track { background: var(--ok); }
.switch input:checked + .switch-track span { transform: translateX(18px); }
.is-disabled { opacity: .5; cursor: not-allowed; }

/* senha */
.pw-meter { display: flex; align-items: center; gap: 10px; margin: 2px 0 6px; }
.pw-bars { display: grid; grid-template-columns: repeat(4, 34px); gap: 4px; }
.pw-bars span { height: 5px; border-radius: 3px; background: var(--line-2); }
.pw-bars .s1 { background: var(--bad); } .pw-bars .s2 { background: #d58a12; } .pw-bars .s3 { background: #6c9d2c; } .pw-bars .s4 { background: var(--ok); }
.pw-label { font-size: 12.5px; color: var(--muted); }
.pw-meter.is-dark .pw-bars span:not(.on) { background: rgba(255, 255, 255, .16); }
.pw-meter.is-dark .pw-label { color: rgba(255, 255, 255, .7); }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .input { font-size: 16px; } /* evita zoom automático no iPhone */
}
