/* ============ Fonte Inter (hospedada no sistema) ============ */
@font-face {
  font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ============ Tokens ============ */
:root {
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --pill: 999px;
  --font: "Inter Variable", "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.3, .7, .3, 1);
  color-scheme: dark;
}

/* Paleta sóbria: azul-acinzentado, tons dessaturados e sombras discretas */
[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #161920;
  --surface-2: #1b1f27;
  --surface-3: #242934;
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .13);
  --text: #e5e8ee;
  --text-soft: #b1b7c3;
  --muted: #7d8494;
  --accent: #8b9dd1;
  --accent-solid: #5a6ea6;
  --accent-hover: #6a7eb8;
  --accent-soft: rgba(139, 157, 209, .13);
  --accent-line: rgba(139, 157, 209, .28);
  --accent-2: #66a9b6;
  --success: #52b08f;
  --success-soft: rgba(82, 176, 143, .13);
  --warn: #cfa352;
  --warn-soft: rgba(207, 163, 82, .13);
  --danger: #d4697b;
  --danger-soft: rgba(212, 105, 123, .13);
  --shadow: 0 12px 32px rgba(0, 0, 0, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .22);
  --overlay: rgba(8, 10, 14, .55);
  --input-bg: rgba(255, 255, 255, .035);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f6f7fa;
  --surface-3: #eceef3;
  --border: rgba(30, 38, 60, .08);
  --border-strong: rgba(30, 38, 60, .16);
  --text: #1c2130;
  --text-soft: #3f475c;
  --muted: #6b7386;
  --accent: #4a5f9c;
  --accent-solid: #4f63a0;
  --accent-hover: #435692;
  --accent-soft: rgba(79, 99, 160, .09);
  --accent-line: rgba(79, 99, 160, .25);
  --accent-2: #3f8a99;
  --success: #2f8f6d;
  --success-soft: rgba(47, 143, 109, .10);
  --warn: #9c7421;
  --warn-soft: rgba(176, 134, 40, .13);
  --danger: #c04a5e;
  --danger-soft: rgba(192, 74, 94, .09);
  --shadow: 0 12px 32px rgba(28, 36, 64, .12);
  --shadow-sm: 0 1px 2px rgba(28, 36, 64, .06);
  --overlay: rgba(28, 33, 48, .32);
  --input-bg: #f6f7fa;
  color-scheme: light;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  font-optical-sizing: auto;
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.015em; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============ Buttons (pill) ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; min-height: 42px;
  border: 1px solid transparent; border-radius: var(--pill);
  background: var(--surface-3); color: var(--text);
  font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease, opacity .25s ease;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:active:not(:disabled) { opacity: .85; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent-solid); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover:not(:disabled) { background: var(--accent-line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger); filter: brightness(1.07); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-danger-soft:hover:not(:disabled) { background: var(--danger-soft); filter: brightness(1.12); }
.btn-sm { padding: 6px 14px; min-height: 34px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: 42px; height: 42px; }
.btn-icon.btn-sm { width: 34px; height: 34px; }
.btn .spinner { width: 16px; height: 16px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; font-size: 13.5px; }
.link-btn:hover { text-decoration: underline; }

/* ============ Inputs ============ */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.hint { font-size: 12.5px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 16px;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea.input { min-height: 90px; resize: vertical; }
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled { opacity: .6; }
select.input { appearance: none; padding-right: 40px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
select.input option { background: var(--surface); color: var(--text); }
input[type="date"].input { min-width: 150px; }
.input-pill { border-radius: var(--pill); padding-left: 20px; padding-right: 20px; }
.input-sm { min-height: 36px; padding: 6px 14px; font-size: 13.5px; }

.pw-field { position: relative; }
.pw-field .input { padding-right: 52px; }
/* Esconde o botão de "revelar senha" nativo do Edge (usamos o nosso ícone) */
.pw-field .input::-ms-reveal, .pw-field .input::-ms-clear { display: none; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: var(--pill); background: transparent;
  color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.pw-toggle:hover { color: var(--text); background: var(--surface-3); }

.pw-rules { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.pw-rules li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); transition: color .2s; }
.pw-rules li .dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex: none; }
.pw-rules li.ok { color: var(--success); }
.pw-rules li.ok .dot { background: var(--success); border-color: var(--success); color: #fff; }
.pw-rules li .dot svg { opacity: 0; }
.pw-rules li.ok .dot svg { opacity: 1; }

/* ============ Cards / badges ============ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: var(--pill); font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-soft); white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge .pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.alert { padding: 12px 16px; border-radius: var(--r-md); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-info { background: var(--accent-soft); color: var(--text-soft); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert svg { flex: none; margin-top: 2px; }

.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--accent-solid); color: #fff; font-weight: 600; font-size: 15px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 96px; height: 96px; font-size: 34px; }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }

.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--accent); animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Lightbox (modal com blur) ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  animation: fade-in .2s ease;
}
.modal {
  width: min(100%, 460px); max-height: calc(100vh - 40px); overflow: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-xl);
  box-shadow: var(--shadow); padding: 28px;
  animation: pop-in .25s var(--ease);
}
.modal-lg { width: min(100%, 640px); }
.modal-xl { width: min(100%, 860px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-head h3 { font-size: 20px; }
.modal-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.modal-body { display: grid; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============ Toasts ============ */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 1100; display: grid; gap: 10px; width: min(360px, calc(100vw - 40px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px 18px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); font-size: 14px;
  animation: pop-in .25s var(--ease);
}
.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }
.toast svg { flex: none; margin-top: 2px; }

/* ============ Auth pages ============ */
.auth-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 420px); padding: 36px 32px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); animation: pop-in .35s var(--ease); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--accent-solid); }
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -.015em; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: -2px; }
.auth-card h1 { font-size: 24px; margin: 26px 0 6px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.form { display: grid; gap: 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.code-input { text-align: center; font-size: 28px; letter-spacing: 12px; font-weight: 700; padding-left: 28px; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 12.5px; color: var(--muted); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 2px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; }
