/* Família Esbizaro — design system (cartão claro sobre fundo slate, hero teal). */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Garante que [hidden] continue oculto mesmo com regras de display nas classes. */
[hidden] { display: none !important; }

:root {
    --bg: #0f172a;
    --card: #fff;
    --ink: #1e293b;
    --muted: #64748b;
    --teal: #0f766e;
    --teal-2: #134e4a;
    --mint: #5eead4;
    --line: #f1f5f9;
}

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Splash screen ---------- */
.splash {
    position: fixed; inset: 0; z-index: 1000;
    background: var(--bg);
    display: grid; place-items: center;
    opacity: 1; transition: opacity .5s ease;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.splash.is-hidden { opacity: 0; pointer-events: none; }

/* Brasão de fundo: retrato no mobile, paisagem no desktop. */
.splash__art {
    position: absolute; inset: 0;
    background-image: url('../img/splash-portrait.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.splash__art::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(15,23,42,.15) 0%, rgba(15,23,42,.55) 70%, rgba(15,23,42,.92) 100%);
}
.splash__overlay {
    position: relative; z-index: 1; text-align: center;
    align-self: end; padding-bottom: 12vh; color: #fff;
}
.splash__title {
    font-size: clamp(1.6rem, 6vw, 2.4rem); font-weight: 800; letter-spacing: .5px;
    text-shadow: 0 2px 18px rgba(0,0,0,.6);
}
.splash__motto {
    color: var(--mint); font-weight: 600; letter-spacing: 2px;
    text-transform: uppercase; font-size: .8rem; margin-top: 6px;
}
.splash__cta {
    display: inline-block; margin-top: 22px; padding: 11px 22px;
    color: #fff; font-weight: 700; font-size: .85rem;
    letter-spacing: 1px; text-transform: uppercase;
    border: 1px solid rgba(94,234,212,.55); border-radius: 999px;
    background: rgba(94,234,212,.10);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: .65; transform: translateY(0); }
    50%      { opacity: 1;   transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
    .splash__cta { animation: none; opacity: 1; }
}

@media (min-width: 760px) {
    .splash__art { background-image: url('../img/splash-landscape.jpg'); }
}

/* ---------- Tela de boas-vindas (eco do splash) ---------- */
body:has(.welcome) { padding: 0; }
.welcome {
    min-height: 100vh; min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    padding: 36px 22px; text-align: center;
    background:
        radial-gradient(120% 75% at 50% -8%, rgba(15,118,110,.38), transparent 62%),
        var(--bg);
}
.welcome__card {
    width: 100%; max-width: 460px;
    display: flex; flex-direction: column; align-items: center;
}
.welcome__crest {
    width: clamp(150px, 44vw, 220px); height: auto; display: block;
    filter: drop-shadow(0 16px 34px rgba(0,0,0,.55));
    margin-bottom: 24px;
}
.welcome__title {
    color: #fff; font-weight: 800; line-height: 1.05;
    font-size: clamp(1.9rem, 7vw, 2.7rem);
    text-shadow: 0 2px 22px rgba(0,0,0,.5);
}
.welcome__motto {
    margin-top: 10px;
    color: var(--mint); font-weight: 600; font-size: .82rem;
    text-transform: uppercase; letter-spacing: 3px;
}
.welcome__lead {
    margin-top: 24px; color: #e2e8f0; font-size: 1.12rem; line-height: 1.5;
}
.welcome__body {
    margin-top: 10px; color: #94a3b8; font-size: .98rem; line-height: 1.6;
    max-width: 34rem;
}
.welcome__actions {
    margin-top: 28px; min-height: 50px;
    display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.welcome__crest--sm { width: clamp(120px, 32vw, 150px); margin-bottom: 18px; }

/* Formulários (login / código) */
.form {
    width: 100%; max-width: 320px; margin-top: 22px;
    display: flex; flex-direction: column; gap: 12px; align-items: stretch;
}
.form-inline { margin-top: 14px; }
.field {
    width: 100%; padding: 14px 16px; border-radius: 12px; text-align: center;
    background: rgba(255,255,255,.06); border: 1px solid rgba(148,163,184,.3);
    color: #f1f5f9; font-size: 1rem;
    transition: border-color .2s ease, background .2s ease;
}
.field::placeholder { color: rgba(148,163,184,.65); }
.field:focus {
    outline: none; border-color: rgba(94,234,212,.6);
    background: rgba(255,255,255,.09);
}
.field--code {
    letter-spacing: 10px; font-size: 1.7rem; font-weight: 700; padding-left: 26px;
}
.form .cta { width: 100%; }
.cta--ghost { border-color: rgba(148,163,184,.35); background: transparent; }
.cta--ghost:hover { background: rgba(148,163,184,.12); }

.alert {
    width: 100%; max-width: 360px; margin-top: 16px;
    padding: 11px 14px; border-radius: 10px; font-size: .9rem; line-height: 1.4;
}
.alert--err { background: rgba(244,63,94,.12); border: 1px solid rgba(244,63,94,.4); color: #fecaca; }
.alert--ok  { background: rgba(94,234,212,.10); border: 1px solid rgba(94,234,212,.4); color: #99f6e4; }

.link { color: var(--mint); text-decoration: none; }
.link:hover { text-decoration: underline; }
.link-btn {
    background: none; border: 0; cursor: pointer;
    color: rgba(226,232,240,.7); font-size: .9rem; text-decoration: underline;
}
.link-btn:hover { color: #fff; }

/* Botão "pill" — mesmo estilo do CTA do splash ("Toque para entrar") */
.cta {
    display: inline-block; cursor: pointer; text-decoration: none;
    padding: 13px 28px; border-radius: 999px;
    color: #fff; font-weight: 700; font-size: .85rem;
    text-transform: uppercase; letter-spacing: 1.5px;
    border: 1px solid rgba(94,234,212,.55);
    background: rgba(94,234,212,.10);
    transition: background .2s ease, transform .2s ease;
}
.cta:hover { background: rgba(94,234,212,.20); transform: translateY(-1px); }

.welcome__hint {
    margin-top: 14px; color: #94a3b8; font-size: .88rem;
    max-width: 30rem; line-height: 1.5;
}
.welcome__version {
    margin-top: 26px; color: rgba(148,163,184,.55);
    font-size: .72rem; letter-spacing: 1px;
}
.welcome__lang { margin-top: 32px; display: flex; gap: 8px; }
.pill {
    text-decoration: none; color: rgba(226,232,240,.75);
    font-weight: 700; font-size: .8rem; letter-spacing: 1px;
    padding: 8px 16px; border-radius: 999px;
    border: 1px solid rgba(148,163,184,.3);
    transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.pill:hover { border-color: rgba(94,234,212,.5); color: #fff; }
.pill.is-active {
    background: rgba(94,234,212,.15);
    border-color: rgba(94,234,212,.55); color: var(--mint);
}

/* ---------- Área logada (painel/admin) ---------- */
.appnav {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 12px 20px;
    background: rgba(15,23,42,.92); backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(148,163,184,.18);
}
.appnav__brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; }
.appnav__brand img { border-radius: 6px; }
.appnav__links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.appnav__links a {
    color: rgba(226,232,240,.8); text-decoration: none; font-weight: 600;
    font-size: .85rem; padding: 8px 12px; border-radius: 8px;
}
.appnav__links a:hover { background: rgba(148,163,184,.12); color: #fff; }
.appnav__exit { color: var(--mint) !important; }

.panel { max-width: 980px; margin: 0 auto; padding: 26px 20px 60px; color: #e2e8f0; }
.panel__head { margin-bottom: 18px; }
.panel__title { color: #fff; font-size: 1.5rem; font-weight: 800; }
.panel__sub { color: #94a3b8; margin-top: 4px; }
.panel__version { margin-top: 30px; color: rgba(148,163,184,.5); font-size: .72rem; letter-spacing: 1px; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.card-link {
    display: flex; flex-direction: column; gap: 4px; padding: 18px;
    background: rgba(255,255,255,.04); border: 1px solid rgba(148,163,184,.2);
    border-radius: 14px; text-decoration: none; transition: border-color .2s, background .2s;
}
.card-link:hover { border-color: rgba(94,234,212,.5); background: rgba(94,234,212,.06); }
.card-link__icon { font-size: 1.6rem; }
.card-link__title { color: #fff; font-weight: 700; }
.card-link__desc { color: #94a3b8; font-size: .85rem; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar__search {
    flex: 1; min-width: 180px; padding: 10px 14px; border-radius: 10px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(148,163,184,.3); color: #f1f5f9;
}
.toolbar__per {
    padding: 10px 12px; border-radius: 10px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(148,163,184,.3); color: #f1f5f9;
}
.btn-sm {
    cursor: pointer; padding: 9px 14px; border-radius: 9px; font-weight: 700;
    font-size: .82rem; text-decoration: none; border: 1px solid transparent;
    background: var(--teal); color: #fff; display: inline-block;
}
.btn-sm:hover { background: var(--teal-2); }
.btn-sm--ghost { background: transparent; border-color: rgba(148,163,184,.35); color: #e2e8f0; }
.btn-sm--ghost:hover { background: rgba(148,163,184,.12); }
.btn-sm--danger { background: rgba(244,63,94,.18); border-color: rgba(244,63,94,.4); color: #fecaca; }
.btn-sm--danger:hover { background: rgba(244,63,94,.28); }
.btn-sm--ok { background: rgba(94,234,212,.15); border-color: rgba(94,234,212,.4); color: #99f6e4; }

.table-wrap { overflow-x: auto; border: 1px solid rgba(148,163,184,.18); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid rgba(148,163,184,.12); white-space: nowrap; }
.table thead th { background: rgba(255,255,255,.03); color: #cbd5e1; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; }
.table thead a { color: inherit; text-decoration: none; }
.table thead a:hover { color: var(--mint); }
.table tbody tr:hover { background: rgba(255,255,255,.02); }
.table__empty { text-align: center; color: #94a3b8; padding: 24px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.badge--on  { background: rgba(94,234,212,.15); color: #5eead4; }
.badge--off { background: rgba(148,163,184,.18); color: #cbd5e1; }
.badge--used { background: rgba(96,165,250,.18); color: #93c5fd; }
.tag--admin { color: var(--mint); font-weight: 700; }
.muted { color: #64748b; }
.muted small, small.muted { display: block; font-size: .72rem; margin-top: 3px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.pager__btn { padding: 8px 14px; border-radius: 9px; background: rgba(255,255,255,.06); border: 1px solid rgba(148,163,184,.3); color: #e2e8f0; text-decoration: none; }
.pager__btn:hover { border-color: rgba(94,234,212,.5); }
.pager__info { color: #94a3b8; font-size: .85rem; }

.formcard { background: rgba(255,255,255,.04); border: 1px solid rgba(148,163,184,.2); border-radius: 14px; padding: 18px; margin-bottom: 20px; }
.formcard__title { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-row .field { flex: 1; min-width: 160px; text-align: left; margin: 0; }
.form-row .cta { width: auto; }
.newlink { background: rgba(94,234,212,.08); border: 1px solid rgba(94,234,212,.35); border-radius: 12px; padding: 14px; margin-bottom: 18px; }
.newlink__label { color: #99f6e4; font-size: .85rem; margin-bottom: 8px; }
.newlink__row { display: flex; gap: 8px; }
.newlink__row .field { margin: 0; text-align: left; }

@media (max-width: 620px) {
    .cards { grid-template-columns: 1fr; }
}

/* ---------- Página / cartão ---------- */
.page {
    max-width: 840px; margin: 0 auto; background: var(--card);
    border-radius: 20px; overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,.4);
}

.hero {
    background: linear-gradient(135deg, var(--teal), var(--teal-2));
    color: #fff; padding: 32px 30px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    flex-wrap: wrap;
}
.hero__brand { display: flex; align-items: center; gap: 16px; }
.hero__logo {
    height: 96px; width: auto; display: block;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
}
.hero__tag {
    display: inline-block; color: var(--mint); font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px; font-size: .7rem;
}
.hero__title { font-size: 1.6rem; font-weight: 800; line-height: 1.1; margin-top: 2px; }

.lang { display: flex; gap: 6px; }
.lang__opt {
    color: rgba(255,255,255,.7); text-decoration: none; font-weight: 700;
    font-size: .8rem; padding: 6px 10px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,.25);
}
.lang__opt.is-active { background: rgba(255,255,255,.18); color: #fff; }

.sec { padding: 26px 30px; border-bottom: 1px solid var(--line); }
.sec:last-child { border-bottom: 0; }
.sec h2 {
    font-size: .78rem; text-transform: uppercase; letter-spacing: 1px;
    color: var(--teal); font-weight: 800; margin-bottom: 12px;
}
.lead { font-size: 1.05rem; color: var(--ink); margin-bottom: 8px; }
.muted { color: var(--muted); line-height: 1.6; }

.btn {
    display: inline-block; margin-top: 16px; cursor: pointer;
    background: var(--teal); color: #fff; border: 0; text-decoration: none;
    font-weight: 700; font-size: .95rem; padding: 12px 20px; border-radius: 10px;
    transition: background .2s ease;
}
.btn:hover { background: var(--teal-2); }
.hint { margin-top: 14px; color: var(--muted); font-size: .9rem; }

@media (max-width: 620px) {
    body { padding: 0; }
    .page { border-radius: 0; min-height: 100vh; box-shadow: none; }
    .hero { border-radius: 0; }
}
