/*
 * Estilos da plataforma. Cores, fontes e raios vêm de /theme.css (variáveis --vesc-*),
 * geradas a partir das configurações do painel. Não usar valores de cor fixos aqui.
 */

.vesc-body {
    background: var(--vesc-bg);
    color: var(--vesc-text);
    font-family: var(--vesc-font);
    -webkit-font-smoothing: antialiased;
}

.vesc-heading,
h1, h2, h3, .h1, .h2, .h3 {
    font-family: var(--vesc-heading-font);
}

.vesc-card {
    background: var(--vesc-surface);
    border: 1px solid rgba(var(--vesc-secondary-rgb), 0.08);
    border-radius: var(--vesc-radius);
}

/* Botões e componentes do Bootstrap ligados aos tokens de marca */
.btn-primary {
    --bs-btn-bg: var(--vesc-primary);
    --bs-btn-border-color: var(--vesc-primary);
    --bs-btn-hover-bg: var(--vesc-primary-hover);
    --bs-btn-hover-border-color: var(--vesc-primary-hover);
    --bs-btn-active-bg: var(--vesc-primary-hover);
    --bs-btn-active-border-color: var(--vesc-primary-hover);
    --bs-btn-disabled-bg: var(--vesc-primary);
    --bs-btn-disabled-border-color: var(--vesc-primary);
    --bs-btn-focus-shadow-rgb: var(--vesc-primary-rgb);
    border-radius: var(--vesc-radius);
}

.form-control,
.form-select {
    border-radius: var(--vesc-radius);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(var(--vesc-primary-rgb), 0.6);
    box-shadow: 0 0 0 0.2rem rgba(var(--vesc-primary-rgb), 0.2);
}

.vesc-badge {
    background: rgba(var(--vesc-primary-rgb), 0.1);
    color: var(--vesc-primary);
    font-weight: 600;
}

/* Área de acesso */
.vesc-auth {
    background:
        radial-gradient(ellipse at top, rgba(var(--vesc-primary-rgb), 0.12), transparent 60%),
        var(--vesc-bg);
}

/* Site provisório */
.vesc-hero {
    background: linear-gradient(135deg, var(--vesc-secondary), var(--vesc-primary));
    color: #fff;
}

/* Administração: barra superior + menu lateral (offcanvas no celular) */
.vesc-topbar {
    background: var(--vesc-secondary);
    min-height: 56px;
}

.vesc-brand {
    color: #fff;
    font-family: var(--vesc-heading-font);
    font-weight: 700;
}

.vesc-brand small {
    font-weight: 400;
    opacity: 0.75;
    font-size: 0.8em;
}

.vesc-brand:hover,
.vesc-brand:focus {
    color: #fff;
}

.vesc-icon-btn,
.vesc-user-btn {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    min-height: 44px;
    min-width: 44px;
}

.vesc-icon-btn:hover,
.vesc-user-btn:hover,
.vesc-user-btn.show {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.vesc-burger,
.vesc-burger::before,
.vesc-burger::after {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    position: relative;
}

.vesc-burger::before,
.vesc-burger::after {
    content: "";
    position: absolute;
    left: 0;
}

.vesc-burger::before { top: -6px; }
.vesc-burger::after { top: 6px; }

.vesc-shell {
    display: flex;
    min-height: calc(100vh - 56px);
}

.vesc-sidebar {
    background: var(--vesc-surface);
}

@media (min-width: 992px) {
    .vesc-sidebar {
        width: 240px;
        flex-shrink: 0;
        border-right: 1px solid rgba(var(--vesc-secondary-rgb), 0.08);
    }
}

.vesc-nav .nav-link {
    color: var(--vesc-text);
    border-radius: var(--vesc-radius);
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.125rem;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.vesc-nav .nav-link:hover {
    background: rgba(var(--vesc-primary-rgb), 0.06);
}

.vesc-nav .nav-link.active {
    background: rgba(var(--vesc-primary-rgb), 0.12);
    color: var(--vesc-primary);
    font-weight: 600;
}

.vesc-main {
    flex: 1;
    min-width: 0;
    padding: 1.25rem 1rem;
}

@media (min-width: 768px) {
    .vesc-main {
        padding: 2rem;
    }
}

.vesc-skip:focus {
    position: absolute;
    z-index: 2000;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--vesc-surface);
    border-radius: var(--vesc-radius);
}

/* ======================================================================
   Área do cliente (mobile first)
   ====================================================================== */
.vesc-customer-top {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 0.5rem 0;
}

.vesc-customer-top .vesc-brand {
    text-decoration: none;
    font-size: 1.15rem;
}

.vesc-top-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--vesc-radius);
}

.vesc-top-link:hover,
.vesc-top-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.vesc-contract-bar {
    background: rgba(0, 0, 0, 0.15);
    padding: 0.375rem 0;
    margin-top: 0.5rem;
    color: #fff;
}

.vesc-contract-form .form-select {
    max-width: 420px;
}

html.js .vesc-js-hide {
    display: none;
}

.vesc-customer-main {
    padding-top: 1.25rem;
    /* espaço para a barra inferior no celular */
    padding-bottom: calc(5rem + env(safe-area-inset-bottom));
}

@media (min-width: 992px) {
    .vesc-customer-main {
        padding-top: 2rem;
        padding-bottom: 3rem;
    }
}

.vesc-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    background: var(--vesc-surface);
    border-top: 1px solid rgba(var(--vesc-secondary-rgb), 0.12);
    padding-bottom: env(safe-area-inset-bottom);
}

.vesc-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    min-height: 56px;
    justify-content: center;
    font-size: 0.72rem;
    color: var(--vesc-muted);
    text-decoration: none;
}

.vesc-bottom-nav a.active {
    color: var(--vesc-primary);
    font-weight: 600;
}

/* Ícones monocromáticos via máscara (herdam a cor do texto) */
.vesc-icon {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    background-color: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.vesc-icon-home { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.vesc-icon-invoice { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2h9l5 5v15H6z'/%3E%3Cpath d='M14 2v6h6M9 13h6M9 17h6'/%3E%3C/svg%3E"); }
.vesc-icon-wifi { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 8.8a15 15 0 0 1 20 0M5 12.5a10 10 0 0 1 14 0M8.5 16.1a5 5 0 0 1 7 0'/%3E%3Ccircle cx='12' cy='19.5' r='1'/%3E%3C/svg%3E"); }
.vesc-icon-user { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E"); }

.vesc-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 96px;
    padding: 1rem 0.5rem;
    text-align: center;
    font-weight: 600;
    color: var(--vesc-primary);
    background: var(--vesc-surface);
    border: 1px solid rgba(var(--vesc-secondary-rgb), 0.08);
    border-radius: var(--vesc-radius);
    text-decoration: none;
}

.vesc-shortcut:hover {
    background: rgba(var(--vesc-primary-rgb), 0.06);
}

.vesc-shortcut .vesc-icon {
    width: 2rem;
    height: 2rem;
}

.vesc-card-alert {
    border-left: 4px solid var(--bs-danger);
}

.vesc-card-active {
    border: 2px solid var(--vesc-primary);
}

.vesc-tabs .nav-link {
    border-radius: var(--vesc-radius);
    color: var(--vesc-text);
}

.vesc-tabs .nav-link.active {
    background: var(--vesc-primary);
}

.vesc-count {
    background: rgba(0, 0, 0, 0.12);
    color: inherit;
}

.vesc-invoice-list .list-group-item {
    min-height: 64px;
}

.vesc-chevron {
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--vesc-muted);
    border-top: 2px solid var(--vesc-muted);
    transform: rotate(45deg);
    flex-shrink: 0;
}

.vesc-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    word-break: break-all;
}

.vesc-qr {
    max-width: 240px;
    margin: 0 auto;
}

.vesc-copied {
    --bs-btn-bg: var(--bs-success);
    --bs-btn-border-color: var(--bs-success);
    --bs-btn-color: #fff;
}

.vesc-dl dt {
    font-weight: 400;
    color: var(--vesc-muted);
    font-size: 0.85rem;
}

.vesc-dl dd {
    margin-bottom: 0.75rem;
}

.vesc-offscreen {
    position: fixed;
    left: -9999px;
    top: 0;
}
