/* ============================================================
   ESPdownloadcenter_0100 — odc.css
   Paleta e proporções replicadas do HTML placeholder aprovado
   ============================================================ */

:root {
    --black: #000000;
    --graphite: #171717;
    --white: #f6f6f6;
    --gray: #a5a5a5;
    --gray-dim: #7a7a7a;
    --orange: #ff8c00;
    --pumpkin: #e94e1b;
    --gold: #ffbf45;
    --line: rgba(255,255,255,.10);
    --danger: #f0a3a3;
    --radius: 20px;
    --grad: linear-gradient(135deg, #ffd16a 0%, #ff8c00 45%, #e94e1b 100%);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html, body {
    height: 100%;
}

body {
    font-family: Inter, system-ui, -apple-system, sans-serif;
    background: #0a0a0a;
    color: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
}

/* ── HEADER ─────────────────────────────────────────────── */
.nav {
    background: rgba(0,0,0,.80);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
}

.nav-inner {
    height: 140px;
    max-height: 140px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    gap: 16px;
}

.brand img {
    width: 130px;
    height: 130px;
    display: block;
    flex: none
}

.btn-ghost {
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.035);
    color: var(--white);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}

    .btn-ghost:hover {
        background: rgba(255,255,255,.07)
    }

/* ── FOOTER ─────────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--line);
    padding: 20px;
}

.footer-line {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--gray-dim);
}

/* ── LOGIN ───────────────────────────────────────────────── */
.view-login {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 20px;
    position: relative;
    isolation: isolate;
}

    /* Background — datacenter quase sumindo no preto */
    .view-login::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: url('/img/background.jpg');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        opacity: 0.08;
        z-index: -2;
        pointer-events: none;
    }

    /* Halo laranja sutil sobre o background */
    .view-login::after {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 70% 15%, rgba(255,140,0,.07), transparent 30%), radial-gradient(circle at 15% 50%, rgba(233,78,27,.05), transparent 25%);
        z-index: -1;
        pointer-events: none;
    }

.login-card {
    width: 100%;
    max-width: 340px;
    background: #0d0d0d;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem;
}

.login-head {
    text-align: center;
    margin-bottom: 1.75rem
}

    /* Remove o anel de foco do h1 alvo do FocusOnNavigate — recurso de
   acessibilidade que move o foco a cada navegação; o outline visual
   não agrega nada aqui e quebra a identidade visual do card. */
    .login-head h1:focus,
    .login-head h1:focus-visible {
        outline: none
    }

.login-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    margin: 0 auto 1rem;
    background: var(--grad);
    display: grid;
    place-items: center;
    font-size: 19px;
    color: #080808;
}

.login-head h1 {
    font-size: 18px;
    margin: 0 0 4px;
    font-weight: 600
}

.login-head p {
    font-size: 13px;
    color: var(--gray);
    margin: 0
}

.field {
    margin-bottom: 14px
}

    .field label {
        font-size: 13px;
        color: var(--gray);
        display: block;
        margin-bottom: 6px
    }

    .field input,
    .field-input {
        width: 100%;
        height: 42px;
        border-radius: 10px;
        border: 1px solid rgba(255,255,255,.13);
        background: #111;
        color: var(--white);
        padding: 0 12px;
        font-size: 14px;
        font-family: inherit;
        outline: none;
        transition: border-color .15s;
    }

        .field input:focus,
        .field-input:focus {
            border-color: var(--orange)
        }

        .field input::placeholder,
        .field-input::placeholder {
            color: #555
        }

        .field input.error,
        .field-input.error {
            border-color: rgba(224,70,70,.6)
        }

/* ── AccessKey com prefixo fixo ─────────────────────────── */
.accesskey-wrap {
    display: flex;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--orange);
    background: #111;
    overflow: hidden;
}

    .accesskey-wrap.error {
        border-color: rgba(224,70,70,.6)
    }

.accesskey-prefix {
    padding: 0 12px;
    background: rgba(255,140,0,.12);
    border-right: 1px solid var(--orange);
    display: flex;
    align-items: center;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    color: var(--orange);
    font-weight: 700;
    letter-spacing: .05em;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

.accesskey-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0 12px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    color: var(--white);
    letter-spacing: .05em;
    outline: none;
}

    .accesskey-input::placeholder {
        color: #555;
        letter-spacing: .05em
    }

.field-error {
    font-size: 12px;
    color: var(--danger);
    display: block;
    margin-top: 4px;
}

.auth-error {
    font-size: 13px;
    color: var(--danger);
    background: rgba(224,70,70,.08);
    border: 1px solid rgba(224,70,70,.25);
    border-radius: 10px;
    padding: 10px 12px;
    margin: 0 0 16px;
    text-align: center;
}

.btn-primary {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 999px;
    color: #080808;
    font-weight: 700;
    font-size: 14px;
    background: var(--grad);
    cursor: pointer;
    font-family: inherit;
    transition: opacity .15s;
}

    .btn-primary:hover {
        opacity: .9
    }

/* Link de destaque — usado no aviso de sessão expirada no dashboard */
.link-accent {
    color: var(--orange);
    text-decoration: none;
}

    .link-accent:hover {
        text-decoration: underline
    }

/* ── DASHBOARD ───────────────────────────────────────────── */
.view-dashboard {
    flex: 1;
    padding: 2rem 20px 3rem
}

.dash-intro {
    font-size: 13px;
    color: var(--gray);
    margin: 0 0 1.25rem
}

.dash-loading, .dash-empty {
    font-size: 13px;
    color: var(--gray-dim)
}

/* 2 colunas fixas — evita o vão vazio do auto-fit com poucos cards.
   Em telas estreitas cai para 1 coluna (ver media query no final). */
.app-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.app-card {
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(160deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
}

    .app-card.locked {
        background: rgba(255,255,255,.02);
        border-color: rgba(255,255,255,.07);
    }

.app-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px
}

.app-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 17px;
    flex: none;
}

    .app-icon.active {
        background: var(--grad);
        color: #080808
    }

    .app-icon.locked {
        background: rgba(255,255,255,.06);
        color: var(--gray-dim)
    }

.app-name {
    font-weight: 600;
    font-size: 14px;
    margin: 0
}

.app-tag {
    font-size: 12px;
    color: var(--gray);
    margin: 0
}

.app-meta {
    font-size: 12px;
    color: #8f8f8f;
    margin: 0 0 12px
}

    .app-meta.locked {
        color: var(--gray-dim)
    }

.btn-download {
    display: block;
    width: 100%;
    height: 38px;
    border: none;
    border-radius: 999px;
    color: #080808;
    font-weight: 700;
    font-size: 12px;
    text-align: center;
    line-height: 38px;
    background: var(--grad);
    text-decoration: none;
    transition: opacity .15s;
}

    .btn-download:hover {
        opacity: .9
    }

.btn-locked {
    width: 100%;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.13);
    background: transparent;
    color: var(--gray-dim);
    font-size: 12px;
    cursor: not-allowed;
    font-family: inherit;
}

/* Em telas estreitas, a grade de produtos cai para 1 coluna */
@media (max-width: 560px) {
    .app-grid {
        grid-template-columns: 1fr;
    }
}
