/* =====================================================================
   WEBTEKPC Auth — sistema de design (paleta da marca)
   ===================================================================== */
:root {
    --brand-orange: #ee8b2d;
    --brand-orange-600: #d9791f;
    --brand-grey: #939598;
    --brand-ink: #262220;
    --brand-ink-2: #322c29;

    --bg: #f4f5f7;
    --surface: #ffffff;
    --text: #1e1b19;
    --text-muted: #6b6763;
    --border: #e4e3e1;
    --danger: #d64545;
    --success: #2e9e5b;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 10px 30px rgba(38, 34, 32, .10);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1b1917;
        --surface: #262220;
        --text: #f2efec;
        --text-muted: #a8a29c;
        --border: #3a342f;
        --shadow: 0 10px 30px rgba(0, 0, 0, .40);
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-orange-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Auth (login / setup) ---- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(1200px 500px at 50% -10%, rgba(238, 139, 45, .12), transparent 60%),
        var(--bg);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 34px 30px;
    text-align: center;
}
.auth-logo { height: 54px; margin-bottom: 18px; }
.auth-card h1 { font-size: 1.35rem; margin: 0 0 6px; letter-spacing: -.01em; }
.auth-card p.sub { color: var(--text-muted); margin: 0 0 26px; font-size: .95rem; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%;
    padding: 13px 18px;
    border: none; border-radius: var(--radius-sm);
    font-size: 1rem; font-weight: 600; font-family: inherit;
    cursor: pointer;
    transition: transform .05s ease, background .15s ease, opacity .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-orange); color: #fff; }
.btn-primary:hover { background: var(--brand-orange-600); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn:disabled { opacity: .55; cursor: default; }

.field { text-align: left; margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.field input {
    width: 100%; padding: 12px 14px; font-size: 1rem; font-family: inherit;
    background: var(--bg); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.field input:focus { outline: 2px solid var(--brand-orange); border-color: transparent; }

.msg { margin-top: 16px; padding: 11px 14px; border-radius: var(--radius-sm); font-size: .9rem; display: none; }
.msg.show { display: block; }
.msg.error { background: rgba(214, 69, 69, .12); color: var(--danger); }
.msg.ok { background: rgba(46, 158, 91, .12); color: var(--success); }

.divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: .8rem; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.recovery-link { display: inline-block; font-size: .88rem; color: var(--text-muted); }
.recovery-link:hover { color: var(--brand-orange-600); }

.recovery-list {
    list-style: none; padding: 16px; margin: 16px 0; text-align: left;
    background: var(--bg); border: 1px dashed var(--brand-orange); border-radius: var(--radius-sm);
    font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1rem; letter-spacing: .05em;
}
.recovery-list li { padding: 3px 0; }

/* ---- Admin shell ---- */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--brand-ink); color: #d9d5d1; padding: 22px 16px; display: flex; flex-direction: column; }
.sidebar nav { flex: 1; }
.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--brand-ink-2); }
.sidebar-user {
    display: block; padding: 8px 12px; border-radius: var(--radius-sm);
    color: #cfc9c4; margin-bottom: 6px; min-width: 0;
}
.sidebar-user:hover { background: var(--brand-ink-2); text-decoration: none; }
.sidebar-user-name { display: block; font-weight: 600; font-size: .9rem; color: #f2efec; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { display: block; font-size: .76rem; color: #948e88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-signout {
    display: flex; align-items: center; gap: 8px; width: 100%;
    background: none; border: 1px solid var(--brand-ink-2); color: #cbc5bf;
    font: inherit; font-size: .85rem; font-weight: 500; padding: 8px 12px;
    border-radius: var(--radius-sm); cursor: pointer;
}
.sidebar-signout:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.sidebar .brand img { height: 30px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: #cfc9c4; font-weight: 500; margin-bottom: 3px;
}
.sidebar nav a:hover { background: var(--brand-ink-2); text-decoration: none; }
.sidebar nav a.active { background: var(--brand-orange); color: #fff; }
.content { padding: 30px 34px; overflow: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.topbar h1 { font-size: 1.4rem; margin: 0; }
.pill { font-size: .8rem; color: var(--text-muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 26px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card .k { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.card .v { font-size: 1.9rem; font-weight: 700; margin-top: 6px; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .92rem; }
th { background: var(--bg); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
tr:last-child td { border-bottom: none; }

/* ---- Componentes da gestão ---- */
.kv { display: flex; gap: 12px; align-items: center; padding: 6px 0; flex-wrap: wrap; }
.kv span { min-width: 120px; color: var(--text-muted); font-size: .85rem; }
.kv code { background: var(--bg); padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); font-family: ui-monospace, Menlo, monospace; font-size: .9rem; user-select: all; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

.linkbtn { background: none; border: none; padding: 0; font: inherit; color: var(--brand-orange-600); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn.danger { color: var(--danger); }

.formcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; max-width: 640px; }
.formcard .field { margin-bottom: 18px; }
.formcard textarea {
    width: 100%; padding: 12px 14px; font-family: ui-monospace, Menlo, monospace; font-size: .92rem;
    background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); resize: vertical;
}
.formcard textarea:focus, .formcard input:focus { outline: 2px solid var(--brand-orange); border-color: transparent; }
.formcard small { display: block; margin-top: 6px; color: var(--text-muted); font-size: .82rem; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: .95rem; color: var(--text); }
.check input { width: auto; }

@media (max-width: 720px) {
    .admin { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .content { padding: 20px 16px; }
}
