/* ============================================================
   FNVPass Painel — Design System (espelha checkout.css)
   ============================================================ */
:root {
  --primary:         #114391;
  --primary-hover:   #0A3272;
  --primary-fg:      #fff;
  --secondary:       #5ea979;
  --secondary-hover: #4d9266;
  --bg:              #f0f3fa;
  --surface:         #ffffff;
  --surface-2:       #f7f9fd;
  --border:          #dce3f0;
  --border-focus:    #114391;
  --text-heading:    #0d1b3e;
  --text-body:       #3a4768;
  --text-muted:      #7e8fad;
  --danger:          #e03c3c;
  --warning:         #d97706;
  --radius-sm:       8px;
  --radius-md:       12px;
  --radius-lg:       16px;
  --radius-pill:     999px;
  --shadow-card:     0 2px 16px rgba(17,67,145,.07), 0 1px 3px rgba(17,67,145,.05);
  --shadow-btn:      0 4px 14px rgba(17,67,145,.28);
  --font:            'Poppins', sans-serif;
  --transition:      .2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: var(--font); background: var(--bg); color: var(--text-body); -webkit-font-smoothing: antialiased; }

/* ── HEADER ────────────────────────────────────────────────── */
.co-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.co-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }

/* Avatar + dropdown do usuário */
.co-user-menu { position: relative; }
.co-user-btn {
  display: flex; align-items: center; gap: 9px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 5px 12px 5px 6px;
  cursor: pointer; font-family: var(--font);
  transition: border-color var(--transition);
}
.co-user-btn:hover { border-color: var(--primary); }
.co-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.co-user-name { font-size: 13px; font-weight: 600; color: var(--text-heading); }

.co-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-card);
  min-width: 180px; padding: 6px 0; display: none; z-index: 200;
}
.co-dropdown.open { display: block; }
.co-dropdown a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 15px; font-size: 13px; color: var(--text-body);
  text-decoration: none; transition: background var(--transition);
}
.co-dropdown a:hover { background: var(--surface-2); }
.co-dropdown a.danger { color: var(--danger); }
.co-dropdown a.danger:hover { background: #fff5f5; }
.co-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── LAYOUT PAINEL ─────────────────────────────────────────── */
.painel-wrap {
  max-width: 1100px; margin: 0 auto;
  padding: 28px 20px 80px;
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 20px;
  align-items: start;
}

/* ── SIDEBAR ───────────────────────────────────────────────── */
.painel-sidebar { display: flex; flex-direction: column; gap: 6px; }

.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-body); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  border: 1px solid transparent;
}
.side-link svg { flex-shrink: 0; color: var(--text-muted); transition: color var(--transition); }
.side-link:hover { background: var(--surface); border-color: var(--border); color: var(--primary); }
.side-link:hover svg { color: var(--primary); }
.side-link.active {
  background: rgba(17,67,145,.07);
  border-color: rgba(17,67,145,.15);
  color: var(--primary); font-weight: 600;
}
.side-link.active svg { color: var(--primary); }
.side-link.sair { color: var(--danger); }
.side-link.sair svg { color: var(--danger); }
.side-link.sair:hover { background: #fff5f5; border-color: #ffd0d0; }
.side-separator { height: 1px; background: var(--border); margin: 4px 0; }

/* Boas-vindas na sidebar */
.side-greeting {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 10px;
}
.side-greeting-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.side-greeting-name { font-size: 13px; font-weight: 600; color: var(--text-heading); }
.side-greeting-email { font-size: 11px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }

/* ── CARD BASE ─────────────────────────────────────────────── */
.co-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.co-card-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.co-card-header-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(17,67,145,.08);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.co-card-title { font-size: 13.5px; font-weight: 700; color: var(--text-heading); }
.co-card-body { padding: 20px; }
.co-card + .co-card { margin-top: 16px; }

/* ── FORM ELEMENTS ─────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-body); margin-bottom: 5px; }
.form-row-2 { display: flex; gap: 10px; }
.form-row-2 .form-group { flex: 1; }

.form-input {
  width: 100%; height: 42px; padding: 0 12px;
  font-family: var(--font); font-size: 13.5px;
  color: var(--text-heading); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input::placeholder { color: var(--text-muted); font-weight: 400; }
.form-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(17,67,145,.1); }
.form-input[readonly] { background: var(--surface-2); color: var(--text-muted); cursor: default; }

.input-group-painel { display: flex; }
.input-group-painel .form-input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none; }
.input-group-painel .eye-btn,
.input-group-painel .search-btn {
  height: 42px; padding: 0 12px;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.input-group-painel .eye-btn:hover,
.input-group-painel .search-btn:hover { background: var(--bg); color: var(--primary); }

/* ── BOTÕES ─────────────────────────────────────────────────── */
.btn-primary-painel {
  width: 100%; height: 44px;
  background: var(--primary); color: #fff;
  font-family: var(--font); font-size: 14px; font-weight: 700;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--transition);
  box-shadow: var(--shadow-btn);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary-painel:hover { background: var(--primary-hover); }
.btn-primary-painel:disabled { opacity: .65; cursor: not-allowed; }

.btn-secondary-painel {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 18px;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  color: var(--primary); background: rgba(17,67,145,.07);
  border: 1.5px solid rgba(17,67,145,.18); border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none; transition: background var(--transition);
}
.btn-secondary-painel:hover { background: rgba(17,67,145,.12); color: var(--primary); }

.btn-danger-painel {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 18px;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  color: var(--danger); background: rgba(224,60,60,.07);
  border: 1.5px solid rgba(224,60,60,.2); border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none; transition: background var(--transition);
}

/* Spinner de loading */
.btn-spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-loading .btn-label { display: none; }
.btn-loading .btn-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── DASHBOARD — MINHA CONTA ───────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 42fr 58fr;
  gap: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: rgba(17,67,145,.08);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-label { font-size: 11.5px; color: var(--text-muted); font-weight: 500; margin-bottom: 3px; }
.stat-number { font-size: 28px; font-weight: 800; color: var(--text-heading); line-height: 1; }

.suporte-card {
  background: var(--secondary);
  border: 1px solid var(--secondary-hover);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  text-decoration: none; transition: background var(--transition);
}
.suporte-card:hover { background: var(--secondary-hover); }
.suporte-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.suporte-label { font-size: 11.5px; color: rgba(255,255,255,.8); font-weight: 500; margin-bottom: 3px; }
.suporte-title { font-size: 15px; font-weight: 700; color: #fff; }

/* ── ÚLTIMAS COMPRAS ──────────────────────────────────────── */
.pedido-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0; border-bottom: 1px solid var(--border);
  gap: 12px;
}
.pedido-item:last-child { border-bottom: none; padding-bottom: 0; }
.pedido-item:first-child { padding-top: 0; }
.pedido-num { font-size: 13.5px; font-weight: 700; color: var(--text-heading); margin-bottom: 2px; }
.pedido-data { font-size: 11.5px; color: var(--text-muted); }
.badge-ok {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--secondary);
  background: #f0faf4; border: 1px solid #b7e4c7;
  border-radius: var(--radius-pill); padding: 3px 10px; white-space: nowrap;
}

/* ── LISTA DE COMPRAS ─────────────────────────────────────── */
.compra-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid var(--border); gap: 12px;
}
.compra-row:last-child { border-bottom: none; padding-bottom: 0; }
.compra-row:first-child { padding-top: 0; }

/* Agrupa resumo (esquerda) + status (direita) para poder quebrar linha
   independente do botão "Ver ingressos" no mobile */
.compra-row-top {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.compra-row-btn { flex-shrink: 0; }

/* CTA :: Comprar mais ingressos */
.cta-mais-ingressos {
  display: flex; align-items: center; gap: 16px;
  margin-top: 16px; padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, #0d3589 0%, #0b6fa5 55%, #0ca8bc 100%);
  color: #fff; text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: filter var(--transition);
}
.cta-mais-ingressos:hover { filter: brightness(1.08); }
.cta-mais-ingressos-icon {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
}
.cta-mais-ingressos-text { flex: 1; min-width: 0; }
.cta-mais-ingressos-title { font-size: 15px; font-weight: 700; }
.cta-mais-ingressos-desc { font-size: 12.5px; opacity: .85; margin-top: 2px; }
.cta-mais-ingressos-arrow { flex-shrink: 0; opacity: .85; }

/* ── STATUS DO PEDIDO (card 50/50) ─────────────────────────── */
.compra-status-grid {
  display: grid; grid-template-columns: 1fr 1fr;
}
.compra-status-left  { padding: 22px; border-right: 1px solid var(--border); }
.compra-status-right { padding: 22px; }
.compra-status-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted); margin-bottom: 10px;
}
.compra-pedido-num   { font-size: 22px; font-weight: 800; color: var(--primary); margin-bottom: 3px; }
.compra-pedido-data  { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.compra-status-msg   { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.compra-pagamento-metodo { font-size: 14px; font-weight: 700; color: var(--secondary); margin-bottom: 16px; }
.compra-valores      { display: flex; gap: 24px; align-items: flex-end; flex-wrap: wrap; }
.compra-valor-label  { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.compra-valor-num    { font-size: 14px; font-weight: 700; color: var(--text-body); }
.compra-valor-total  { font-size: 20px; font-weight: 800; color: var(--primary); }

/* Badge cancelado */
.badge-cancelado {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: #b91c1c;
  background: #fef2f2; border: 1px solid #fca5a5;
  border-radius: var(--radius-pill); padding: 3px 10px; white-space: nowrap;
}

/* Card de compra cancelada */
.compra-cancelada {
  border-radius: var(--radius-lg); border: 1.5px solid #dc2626;
  overflow: hidden; box-shadow: var(--shadow-card); margin-bottom: 16px;
}
.compra-cancelada-body {
  background: #fef2f2; display: grid; grid-template-columns: 1fr 1fr;
}
.compra-cancelada-left {
  padding: 20px; border-right: 1px solid #fca5a5;
  display: flex; gap: 14px; align-items: flex-start;
}
.compra-cancelada-icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  background: #dc2626; display: flex; align-items: center; justify-content: center;
}
.compra-cancelada-titulo { font-size: 14px; font-weight: 700; color: #991b1b; margin-bottom: 6px; }
.compra-cancelada-motivo { font-size: 12.5px; color: #b91c1c; line-height: 1.5; }
.compra-cancelada-right  { padding: 20px; }
.compra-cancelada-etitulo { font-size: 14px; font-weight: 700; color: #991b1b; margin-bottom: 6px; }
.compra-cancelada-edata   { font-size: 12.5px; color: #b91c1c; }

/* ── INGRESSO ─────────────────────────────────────────────── */
.ingresso-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.ingresso-header {
  background: linear-gradient(90deg, #0d3589 0%, #0b6fa5 55%, #0ca8bc 100%);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.ingresso-body { background: var(--surface); padding: 20px; }

/* Layout interno do ingresso: thumb | info | qr */
.ingresso-layout {
  display: flex; align-items: center; gap: 20px;
}
.ingresso-thumb {
  flex-shrink: 0; width: 160px; border-radius: var(--radius-sm); overflow: hidden;
}
.ingresso-thumb img { width: 100%; display: block; }
.ingresso-info-col { flex: 1; min-width: 0; }
.ingresso-qr-col   { flex-shrink: 0; width: 130px; }
.ingresso-qr-col img { width: 100%; display: block; }

.ingresso-titulo   { font-size: 15px; font-weight: 700; color: var(--text-heading); margin-bottom: 12px; }
.ingresso-label    { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 3px; }
.ingresso-date     { font-size: 14px; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.ingresso-passaporte { font-size: 20px; font-weight: 800; letter-spacing: .04em; color: var(--text-heading); }

.btn-download {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--radius-sm); padding: 7px 14px;
  text-decoration: none; transition: background var(--transition);
}
.btn-download:hover { background: rgba(255,255,255,.28); color: #fff; }

/* Preparando ingressos */
.ingresso-aguardando {
  background: linear-gradient(135deg, var(--primary), #1a56b0);
  border-radius: var(--radius-lg); padding: 40px 24px;
  text-align: center; color: #fff;
}
.ingresso-aguardando h2 { font-size: 20px; font-weight: 700; margin: 16px 0 8px; }
.ingresso-aguardando p  { font-size: 13px; opacity: .85; margin-bottom: 20px; }

/* Totais da compra */
.totais-row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 13px; border-bottom: 1px solid var(--surface-2); }
.totais-row:last-child { border-bottom: none; padding-top: 13px; margin-top: 4px; border-top: 1.5px solid var(--border) !important; }
.totais-label { color: var(--text-muted); font-weight: 500; }
.totais-value { font-weight: 600; color: var(--text-body); }
.totais-row:last-child .totais-label { font-size: 14.5px; font-weight: 700; color: var(--text-heading); }
.totais-row:last-child .totais-value { font-size: 20px; font-weight: 800; color: var(--primary); }

/* Responsivo ingresso */
@media (max-width: 640px) {
  .ingresso-layout { flex-wrap: wrap; }
  .ingresso-thumb  { width: 100%; }
  .ingresso-qr-col { width: 110px; margin: 0 auto; }
  .compra-status-grid { grid-template-columns: 1fr; }
  .compra-status-left { border-right: none; border-bottom: 1px solid var(--border); }
  .compra-cancelada-body { grid-template-columns: 1fr; }
  .compra-cancelada-left { border-right: none; border-bottom: 1px solid #fca5a5; }
}

/* ── AUTH ─────────────────────────────────────────────────── */
.auth-body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }

.auth-main {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(17,67,145,.1);
  padding: 32px 28px;
  width: 100%; max-width: 420px;
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-title { font-size: 17px; font-weight: 700; color: var(--text-heading); margin-bottom: 20px; text-align: center; }

.divider-or {
  display: flex; align-items: center; gap: 12px;
  font-size: 11.5px; color: var(--text-muted); font-weight: 500;
  margin: 16px 0;
}
.divider-or::before, .divider-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.auth-link { font-size: 12.5px; color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

/* Seção de campos de meus dados */
.section-header {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ── RESPONSIVO ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .painel-wrap {
    grid-template-columns: 1fr;
  }

  .side-greeting {
    display: none;
  }

  /* Menu responsivo: 4 itens em uma única linha */
  .painel-sidebar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .painel-sidebar .side-link {
    width: 100%;
    min-width: 0;
    min-height: 76px;
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    font-size: 11.5px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
  }

  .painel-sidebar .side-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .side-separator {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .painel-wrap { padding: 14px 12px 60px; gap: 12px; }
  .co-card-body { padding: 14px; }
  .co-header { padding: 0 14px; }
}

@media (max-width: 480px) {
  .painel-sidebar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .painel-sidebar .side-link {
    min-height: 72px;
    padding: 8px 2px;
    gap: 5px;
    font-size: 10px;
  }

  .painel-sidebar .side-link svg {
    width: 18px;
    height: 18px;
  }
}

/* Card de compra: resumo à esquerda + status à direita em cima,
   botão "Ver ingressos" 100% da largura embaixo */
@media (max-width: 520px) {
  .compra-row,
  .pedido-item {
    flex-wrap: wrap;
  }
  .compra-row-top { flex-basis: 100%; }
  .compra-row-btn {
    flex-basis: 100%;
    width: 100%;
    justify-content: center;
  }

  .cta-mais-ingressos { flex-wrap: wrap; text-align: center; justify-content: center; }
  .cta-mais-ingressos-arrow { display: none; }
}