/* ================================================================
   main.css — Estilos globais do VemFácil
   ================================================================ */

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --accent:        #f97316;
    --accent-hover:  #ea6b02;
    --accent-dim:    #fff7ed;
    --surface:       #ffffff;
    --bg:            #f6f7f9;
    --border:        #e8eaed;
    --text:          #111827;
    --text-muted:    #6b7280;
    --text-light:    #9ca3af;
    --radius:        12px;
    --radius-sm:     8px;
    --nav-h:         62px;
    --shadow-sm:     0 1px 4px rgba(0,0,0,.07);
    --shadow-md:     0 4px 16px rgba(0,0,0,.10);
    --transition:    .18s ease;
}

html {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

/* ── Navegação ──────────────────────────────────────────────────── */
.vf-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    height: var(--nav-h);
}

.vf-nav-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 28px;
}

/* Logo */
.vf-nav-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    text-decoration: none;
}
.vf-nav-logo-icon { width: 32px; height: 32px; flex-shrink: 0; }
.vf-nav-logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.03em;
}

/* Links centrais (mantido para compatibilidade futura) */
.vf-nav-links { display: none; }

/* Área de autenticação */
.vf-nav-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

/* ── Botões genéricos da nav ────────────────────────────────────── */
.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 24px;
    font-size: .84rem;
    font-weight: 700;
    transition: opacity var(--transition), transform var(--transition), background var(--transition);
    white-space: nowrap;
    cursor: pointer;
}
.nav-btn:hover { opacity: .85; transform: translateY(-1px); }
.nav-btn-ghost {
    color: var(--text-muted);
    background: transparent;
    border: 1.5px solid var(--border);
}
.nav-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn-primary {
    background: var(--accent);
    color: #fff;
    border: 1.5px solid transparent;
}
.nav-btn-primary:hover { background: var(--accent-hover); }

/* ── Chip de saldo ──────────────────────────────────────────────── */
.nav-saldo {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 24px;
    border: 1.5px solid var(--border);
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    transition: border-color var(--transition);
    text-decoration: none;
}
.nav-saldo svg { width: 15px; height: 15px; color: #f59e0b; flex-shrink: 0; }
.nav-saldo:hover { border-color: var(--accent); }
@media (max-width: 480px) { .nav-saldo-label { display: none; } }

/* ── Avatar button (usuário logado) ─────────────────────────────── */
.nav-user {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition), box-shadow var(--transition);
    overflow: hidden;
    flex-shrink: 0;
}
.nav-avatar-btn:hover,
.nav-avatar-btn[aria-expanded="true"] {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.nav-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.nav-avatar-initials {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: .03em;
    user-select: none;
}

/* ── Dropdown ───────────────────────────────────────────────────── */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 230px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 8px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity var(--transition), transform var(--transition);
    z-index: 200;
}
.nav-dropdown--open,
.nav-avatar-btn[aria-expanded="true"] + .nav-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.nav-dd-header {
    padding: 8px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}
.nav-dd-header strong { font-size: .9rem; font-weight: 700; color: var(--text); }
.nav-dd-header small  { font-size: .75rem; color: var(--text-muted); }
.nav-dd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: .84rem;
    font-weight: 600;
    color: var(--text);
    transition: background var(--transition);
    cursor: pointer;
    width: 100%;
    text-align: left;
    text-decoration: none;
    background: none;
    border: none;
    font-family: inherit;
}
.nav-dd-item svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.nav-dd-item:hover { background: var(--bg); }
.nav-dd-sep { border: none; border-top: 1px solid var(--border); margin: 6px 0; }
.nav-dd-logout { color: #dc2626; }
.nav-dd-logout svg { color: #dc2626; }
.nav-dd-logout:hover { background: #fef2f2; }

/* ── Modal de Login (PHP component) ─────────────────────────────── */
.vf-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.vf-modal-overlay.vf-modal--open {
    display: flex;
}

.vf-modal-box {
    background: var(--surface);
    border-radius: 16px;
    padding: 32px 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    position: relative;
    animation: modal-in .2s ease;
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.vf-modal-fechar {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.vf-modal-fechar:hover { background: var(--bg); color: var(--text); }
.vf-modal-fechar svg { width: 18px; height: 18px; }

.vf-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}
.vf-modal-logo { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; }
.vf-modal-titulo {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}
.vf-modal-sub { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

.vf-modal-erro {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.vf-modal-form { display: flex; flex-direction: column; gap: 16px; }

.vf-modal-campo { display: flex; flex-direction: column; gap: 6px; }
.vf-modal-campo label {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text);
}
.vf-modal-campo input {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: .9rem;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    background: var(--surface);
    width: 100%;
}
.vf-modal-campo input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.vf-modal-pw-wrap { position: relative; display: flex; }
.vf-modal-pw-wrap input { padding-right: 44px; flex: 1; }
.vf-modal-pw-toggle {
    position: absolute; right: 0; top: 0; bottom: 0;
    width: 42px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: color .15s;
    background: none;
    border: none;
    cursor: pointer;
}
.vf-modal-pw-toggle:hover { color: var(--accent); }
.vf-modal-pw-toggle svg { width: 18px; height: 18px; }

.vf-modal-submit {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 11px;
    font-size: .9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition);
    margin-top: 4px;
    width: 100%;
}
.vf-modal-submit:hover:not(:disabled) { background: var(--accent-hover); }
.vf-modal-submit:disabled { opacity: .6; cursor: not-allowed; }

.vf-modal-rodape {
    text-align: center;
    font-size: .8rem;
    color: var(--text-muted);
    padding-top: 4px;
}
.vf-modal-rodape a { color: var(--accent); font-weight: 700; }
.vf-modal-rodape a:hover { text-decoration: underline; }

/* ── Utilitários ───────────────────────────────────────────────── */
.container {
    width: 100%;
    padding: 0 28px;
}
.visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}
