/* ===================================================================
    🔤 FONTE PADRÃO BROTO
=================================================================== */
@font-face {
    font-family: "Gordita";
    src: url("/static/fonts/Gordita.woff2") format("woff2");
    font-weight: 400;
}

/* ===================================================================
    🎨 PALETA DE CORES BROTO (DESIGN SYSTEM)
=================================================================== */
:root {
    --broto-yellow: #FCFC30;
    --broto-blue: #465EFF;
    --broto-blue-dark: #354AF5;
    --broto-white: #FFFFFF;

    --text-main: #111827;
    --text-muted: #6b7280;

    --success: #22c55e;
    --success-dark: #16a34a;

    --danger: #e11d48;
    --danger-dark: #c51038;

    --soft-blue: #eef0ff;
    --soft-blue-hover: #dfe3ff;

    --bg-light: #f6f7ff;

    --border: #d6dbff;
}

/* ===================================================================
    🔧 RESET BÁSICO
=================================================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: "Gordita", system-ui, sans-serif;
    background: var(--broto-yellow);
    margin: 0;
    padding: 25px 14px;
    font-size: 15px;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===================================================================
    🟦 BOTÕES UNIVERSAIS BROTO
=================================================================== */

.broto-btn {
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.15s ease;
    border: 1px solid transparent;
}

/* Azul */
.broto-btn-blue {
    background: var(--broto-blue);
    color: white;
}
.broto-btn-blue:hover {
    filter: brightness(1.1);
}

/* Verde */
.broto-btn-green {
    background: var(--success);
    color: white;
}
.broto-btn-green:hover {
    background: var(--success-dark);
}

/* Claro */
.broto-btn-light {
    background: var(--soft-blue);
    border: 1px solid var(--border);
    color: var(--broto-blue);
}
.broto-btn-light:hover {
    background: var(--soft-blue-hover);
}

/* Vermelho */
.broto-btn-danger {
    background: var(--danger);
    border: 1px solid #d6193c;
    color: white;
}
.broto-btn-danger:hover {
    background: var(--danger-dark);
}

/* Desabilitado */
.broto-btn.disabled {
    opacity: .35;
    pointer-events: none;
}

/* ===================================================================
    🔐 TELA DE LOGIN
=================================================================== */

.login-body {
    background: var(--broto-yellow);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: var(--broto-white);
    padding: 40px 42px;
    border-radius: 22px;
    text-align: center;
    max-width: 520px;
    width: 100%;
    box-shadow:
        0 25px 50px rgba(0,0,0,0.15),
        0 0 0 1px rgba(0,0,0,0.05);
}

/* ✅ CORRIGIDO: centraliza logo */
.login-logo {
    width: 180px;
    margin: 0 auto 22px;
    display: block;
}

.login-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.login-subtitle {
    color: var(--text-muted);
    margin-bottom: 26px;
}

/* Inputs */
.login-form label {
    display: block;
    margin-top: 14px;
    font-weight: 600;
    text-align: left;
    color: var(--text-main);
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-top: 6px;
    background: #f9fafb;
}

.login-form input:focus {
    border-color: var(--broto-blue);
    outline: none;
    box-shadow: 0 0 0 1px rgba(70,94,255,0.35);
}

.login-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* Botão login */
.login-btn {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    margin-top: 22px;
    border: none;
    cursor: pointer;
    background: var(--broto-blue);
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    transition: 0.15s;
}
.login-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

/* Mensagens */
.msg {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-weight: 600;
}
.msg-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.msg-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.login-footer {
    margin-top: 22px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===================================================================
    📤 PÁGINA DE UPLOAD
=================================================================== */

.upload-body {
    background: var(--broto-yellow);
    min-height: 100vh;
    padding-top: 120px;
}

.upload-topbar-fixed {
    position: fixed;
    top: 22px;
    right: 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
}

.upload-topbar-fixed .timer {
    padding: 6px 14px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--broto-blue);
}

.upload-topbar-fixed .logout-btn {
    padding: 6px 16px;
    border-radius: 999px;
    border: 2px solid var(--danger);
    background: transparent;
    color: var(--danger);
    font-weight: 700;
    cursor: pointer;
}
.upload-topbar-fixed .logout-btn:hover {
    background: var(--danger);
    color: white;
}

/* Card Upload */
.upload-container {
    background: white;
    padding: 40px 45px;
    border-radius: 22px;
    max-width: 520px;
    margin: auto;
    box-shadow:
        0 25px 50px rgba(0,0,0,0.15),
        0 0 0 1px rgba(0,0,0,0.05);

    /* ✅ NOVO: centraliza título/subtítulo/logo/mensagens */
    text-align: center;
}

/* ✅ NOVO: mantém o formulário alinhado à esquerda */
.upload-form {
    text-align: left;
}

/* Conteúdo */
.upload-title {
    font-size: 1.8rem;
    font-weight: 700;
}
.upload-subtitle {
    color: var(--text-muted);
    margin-bottom: 25px;
}

/* Inputs */
.upload-form input[type="file"],
.upload-form input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-top: 6px;
    background: #f9fafb;
}

/* Botão */
.upload-btn {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    background: var(--success);
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    border: none;
    cursor: pointer;
    margin-top: 18px;
}
.upload-btn:hover {
    background: var(--success-dark);
}

/* ===================================================================
    🗂️ EXPLORADOR DE ARQUIVOS
=================================================================== */

.explorer-topbar {
    background: white;
    padding: 18px 28px;
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.07);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.explorer-title {
    flex: 1;
    text-align: center;
    font-weight: 700;
    font-size: 1.4rem;
}

.btn-back {
    background: var(--soft-blue);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 12px;
    color: var(--broto-blue);
    font-weight: 700;
}
.btn-back:hover {
    background: var(--soft-blue-hover);
}

.btn-logout {
    padding: 10px 20px;
    border-radius: 12px;
    background: var(--danger);
    border: 1px solid #d6193c;
    color: white;
    font-weight: 700;
}
.btn-logout:hover {
    background: var(--danger-dark);
}

.empresa-container {
    background: var(--bg-light);
    padding: 14px 18px;
    max-width: 1000px;
    margin: 0 auto 15px;
    border-radius: 12px;
}

/* Título Broto */
.section-title-broto {
    font-size: 20px;
    font-weight: 700;
    color: var(--broto-blue);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.broto-icon {
    width: 20px;
    height: 20px;
}

.empresa-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.empresa-pill {
    padding: 8px 16px;
    border-radius: 16px;
    border: 2px solid var(--broto-blue);
    color: var(--broto-blue);
    background: white;
    font-weight: 700;
    text-decoration: none;
}
.empresa-pill:hover,
.empresa-pill.active {
    background: var(--broto-blue);
    color: white;
}

.explorer-container {
    background: white;
    padding: 28px;
    border-radius: 18px;
    max-width: 1000px;
    margin: auto;
}

.explorer-path {
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--broto-blue);
}

.explorer-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.btn-icon {
    background: var(--broto-blue);
    color: white;
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 700;
    cursor: pointer;
}

.upload-label {
    background: var(--soft-blue);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    color: var(--broto-blue);
}

.btn-upload {
    background: var(--success);
    color: white;
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 700;
    border: none;
}

.explorer-table {
    width: 100%;
    border-collapse: collapse;
}

.explorer-table tr {
    border-bottom: 1px solid #ececec;
}

.explorer-table td {
    padding: 12px 10px;
    font-size: 0.95rem;
}

/* ✅ CORRIGIDO: links sem underline ("grifado") */
.file-link {
    color: var(--broto-blue);
    font-weight: 700;
    text-decoration: none;
}
.file-link:hover,
.file-link:focus,
.file-link:active,
.file-link:visited {
    text-decoration: none;
}

.actions-cell {
    display: flex;
    gap: 14px;
}

.icon {
    cursor: pointer;
    font-size: 20px;
    opacity: .8;
}
.icon:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* ===================================================================
    🔐 ESPECIAIS — MFA, ALTERAR SENHA, ETC.
=================================================================== */

.cp-container,
.mfa-container {
    max-width: 430px;
    margin: 50px auto;
    background: white;
    padding: 35px;
    border-radius: 14px;
    box-shadow:
        0 6px 20px rgba(0,0,0,0.08),
        0 0 0 1px rgba(0,0,0,0.03);
    border: 1px solid var(--border);
    text-align: center;
}

.cp-title,
.mfa-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--broto-blue);
    margin-bottom: 10px;
}

.cp-description,
.mfa-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 18px;
}

/* Inputs e grupos */
.input-group {
    text-align: left;
    margin-bottom: 18px;
}

.input-group input,
.mfa-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: white;
    font-size: 15px;
    color: var(--text-main);
    margin-top: 6px;
}

.input-group input:focus,
.mfa-input:focus {
    border-color: var(--broto-blue);
    outline: none;
    box-shadow: 0 0 0 1px rgba(70,94,255,0.35);
}

/* Mostrar senha */
.password-wrapper {
    position: relative;
}
.password-wrapper input {
    padding-right: 42px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-muted);
}
.toggle-password:hover {
    color: var(--broto-blue);
}

/* CapsLock */
.caps-warning {
    font-size: 0.75rem;
    color: var(--danger);
    font-weight: 600;
    margin-top: 4px;
    display: none;
}

/* Botão submit */
.btn-submit {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    background: var(--broto-blue);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: .15s;
}
.btn-submit:hover {
    background: var(--broto-blue-dark);
}

/* Mensagens */
.msg-box {
    margin-top: 16px;
}

.msg {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.msg-error {
    background: rgba(225, 29, 72, 0.10);
    color: var(--danger);
    border: 1px solid rgba(225,29,72,0.3);
}

.msg-success {
    background: rgba(16,185,129,0.10);
    color: var(--success);
    border: 1px solid rgba(16,185,129,0.3);
}

/* Política */
.policy-box {
    background: var(--bg-light);
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: left;
}

/* MFA — campo código */
.mfa-input {
    text-align: center;
    letter-spacing: 0.25em;
    font-size: 1.4rem !important;
    max-width: 200px;
    margin: 0 auto;
}

/* QR Code */
.mfa-qr {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}
.mfa-qr img {
    width: 200px;
    height: 200px;
    padding: 8px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* Dica MFA */
.mfa-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ===================================================================
    📱 RESPONSIVIDADE
=================================================================== */
@media (max-width: 600px) {
    .explorer-topbar {
        flex-direction: column;
        gap: 10px;
    }
    .explorer-actions {
        flex-direction: column;
    }
    .upload-topbar-fixed {
        right: 50%;
        transform: translateX(50%);
        flex-direction: column;
        gap: 6px;
    }
}

/* ===================================================================
   🧱 LAYOUT ADMIN (HEADER / CARD / FOOTER)
   Usado no admin_explorer.html
=================================================================== */

/* Remove padding global APENAS no admin */
.admin-body {
    padding: 0 !important;
}

/* Header admin */
.admin-header {
    background: var(--broto-yellow);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid rgba(0,0,0,0.08);

    /* ✅ NOVO: necessário para centralizar título absoluto */
    position: relative;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Logo Broto no admin */
.admin-header-logo {
    height: 30px;     /* tamanho ideal p/ header 64px */
    width: auto;
    display: block;
    object-fit: contain;
}

/* Título admin */
.admin-header-title {
    font-weight: 800;
    color: var(--text-main);
    font-size: 1rem;
    white-space: nowrap;

    /* ✅ NOVO: centraliza no header */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* ✅ Opcional: evita colisão em telas menores */
@media (max-width: 700px) {
    .admin-header-title {
        position: static;
        transform: none;
        margin-left: 12px;
    }
}

/* Wrapper amarelo */
.admin-wrapper {
    background: var(--broto-yellow);
    min-height: calc(100vh - 64px - 48px);
    padding: 28px 24px 32px;
}

/* Card branco central */
.admin-card {
    background: var(--broto-white);
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 18px;
    padding: 26px 26px 30px;
    box-shadow:
        0 25px 50px rgba(0,0,0,0.12),
        0 0 0 1px rgba(0,0,0,0.04);
}

/* Footer admin */
.admin-footer {
    height: 48px;
    background: var(--broto-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
