@font-face { font-family: "Figtree"; src: url("/vendor/fonts/figtree/figtree-latin-wght-normal.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("/vendor/fonts/bricolage/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --bg: #14120e;
  --panel: #1d1a15;
  --panel-2: #27231c;
  --line: #3a342b;
  --text: #f2ebdd;
  --muted: #a59c8b;
  --accent: #ff6a3d;
  --accent-ink: #1c0d06;
  --ok: #a3d977;
  --danger: #ff7a7a;
  --radius: 12px;
  --font-display: "Bricolage", "Figtree", sans-serif;
  --font-body: "Figtree", "Helvetica Neue", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font-body); font-size: 15px; line-height: 1.5; color: var(--text); background-color: var(--bg);
  background-image: linear-gradient(rgba(242, 235, 221, .028) 1px, transparent 1px), linear-gradient(90deg, rgba(242, 235, 221, .028) 1px, transparent 1px);
  background-size: 32px 32px; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---- controles ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .62rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn:focus-visible, .input:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { border-color: #ffb199; background: #ff7c54; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); }
.btn-sm { padding: .38rem .8rem; font-size: .85rem; }
.field { display: grid; gap: .4rem; margin-bottom: 1.1rem; }
.field > span, .label { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field small, .hint { color: var(--muted); font-size: .82rem; }
.input {
  width: 100%; padding: .7rem .85rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit;
}
textarea.input { resize: vertical; min-height: 5.5rem; }
textarea.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .82rem; line-height: 1.5; min-height: 9rem; white-space: pre; }
.row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  padding: .4rem .85rem; border-radius: 999px; border: 1px dashed var(--line); background: transparent; color: var(--muted); font: inherit; font-size: .88rem; cursor: pointer;
}
.chip[aria-pressed="true"] { border-style: solid; border-color: var(--accent); color: var(--text); background: rgba(255, 106, 61, .14); }
.notice { padding: .8rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); font-size: .9rem; color: var(--muted); margin-bottom: 1.1rem; }
.notice strong { color: var(--text); }
.notice-warn { border-color: rgba(255, 106, 61, .5); }
.error-text { color: var(--danger); font-size: .9rem; min-height: 1.2em; margin: .25rem 0 0; }
.ok-text { color: var(--ok); }

/* ---- login ---- */
.login { min-height: 100%; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: min(400px, 100%); padding: 2.4rem; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 40px 80px -40px #000; animation: rise .5s ease both; }
.login-card h1 { font-size: 2.1rem; margin-bottom: .4rem; }
.login-card p { color: var(--muted); margin: 0 0 1.6rem; }
.brand-mark { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; margin-bottom: 1.4rem; transform: rotate(-6deg); }

/* ---- painel ---- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem clamp(1rem, 4vw, 3rem); border-bottom: 1px solid var(--line); background: rgba(20, 18, 14, .85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: .7rem; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.brand .brand-mark { width: 32px; height: 32px; font-size: 1rem; margin: 0; border-radius: 9px; }
.top-actions { display: flex; gap: .5rem; align-items: center; }
.wrap { max-width: 1180px; margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem) 5rem; }
.hero-line { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2.5rem; }
.hero-line h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); max-width: 14ch; }
.hero-line h1 em { font-style: normal; color: var(--accent); }
.hero-line p { color: var(--muted); margin: .9rem 0 0; max-width: 46ch; }
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; animation: rise .45s ease both; transition: border-color .2s ease, transform .2s ease; }
.card:hover { border-color: var(--muted); transform: translateY(-3px); }
.card-thumb { position: relative; height: 150px; background: var(--panel-2); border-bottom: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: .9rem; text-align: center; padding: 1rem; }
.card-thumb iframe { position: absolute; inset: 0; width: 400%; height: 400%; transform: scale(.25); transform-origin: 0 0; border: 0; pointer-events: none; background: #fff; }
.card-thumb a { position: absolute; inset: 0; z-index: 1; }
.card-body { padding: 1rem 1.1rem 1.1rem; display: grid; gap: .75rem; }
.card-title { font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { color: var(--muted); font-size: .82rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.empty { border: 1px dashed var(--line); border-radius: 16px; padding: 4rem 1.5rem; text-align: center; color: var(--muted); }
.empty h2 { color: var(--text); font-size: 1.6rem; margin-bottom: .5rem; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 0 auto .7rem; }
.banner { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; padding: .9rem 1.1rem; margin-bottom: 2rem; border: 1px solid rgba(255, 106, 61, .5); border-radius: var(--radius); background: rgba(255, 106, 61, .08); }

/* ---- diálogos ---- */
dialog { width: min(680px, calc(100% - 2rem)); max-height: calc(100% - 2rem); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--text); box-shadow: 0 50px 100px -30px #000; }
dialog::backdrop { background: rgba(8, 7, 5, .7); backdrop-filter: blur(3px); }
dialog[open] { animation: rise .25s ease both; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.3rem 1.6rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.dlg-head h2 { font-size: 1.5rem; }
.dlg-body { padding: 1.5rem 1.6rem; }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; padding: 1.1rem 1.6rem; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--panel); }
.x { background: none; border: 0; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; padding: .2rem .5rem; border-radius: 8px; }
.x:hover { color: var(--text); background: var(--panel-2); }
.tabs { display: flex; gap: .3rem; margin-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.tab { padding: .6rem 1rem; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; margin-bottom: -1px; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.color-row { display: flex; align-items: center; gap: .8rem; }
.color-row input[type="color"] { width: 46px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; }
.check { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .9rem; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; background: var(--bg); padding: .1em .4em; border-radius: 5px; border: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 1.6rem; transform: translateX(-50%); padding: .7rem 1.2rem; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; z-index: 9999; animation: rise .25s ease both; max-width: calc(100% - 2rem); box-shadow: 0 12px 30px -10px #000; }
.toast.is-error { background: var(--danger); color: #2a0808; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.toast { animation-name: toast-in; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
