/* ═══════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════ */
:root {
  --brand: #065f46;
  --brand-dark: #064e3b;
  --brand-mid: #047857;
  --brand-light: #d1fae5;
  --brand-soft: #ecfdf5;
  --accent: #b45309;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --ink: #0f172a;
  --ink-mid: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --subtle: #f1f5f9;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --sh-sm: 0 1px 3px rgba(0, 0, 0, .07);
  --sh: 0 4px 14px rgba(0, 0, 0, .09);
  --sh-lg: 0 12px 40px rgba(0, 0, 0, .13);
  --t: 180ms ease;
}

/* ═══════════════════════════════════════════
   RESET
═══════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  cursor: pointer;
  font: inherit;
  border: none;
  background: none;
}

button:disabled {
  cursor: not-allowed;
}

input,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════
   LOGIN
═══════════════════════════════════════════ */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    linear-gradient(rgba(0, 0, 0, .52), rgba(0, 0, 0, .52)),
    url('/static/bg-login.jpg') center/cover;
  background-color: #0a2e18;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-lg);
}

.login-banner {
  height: 60px;
  background-image: url("imagens/topo-login.png");
  background-size: cover;
  background-position: center;
}

.login-banner-slice {
  display: none;
}

.login-banner-slice:nth-child(1) {
  background: #197a3b;
  left: -5%;
  width: 32%;
}

.login-banner-slice:nth-child(2) {
  background: #e8891a;
  left: 17%;
  width: 32%;
}

.login-banner-slice:nth-child(3) {
  background: #4ab5a0;
  left: 39%;
  width: 32%;
}

.login-banner-slice:nth-child(4) {
  background: #f5c518;
  left: 61%;
  width: 32%;
}

.login-banner-slice:nth-child(5) {
  background: #2160a8;
  left: 83%;
  width: 32%;
}

.login-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}

.login-logo-img {
  height: 110px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

.login-form-body {
  padding: 24px;
}

.login-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--ink);
  text-align: center;
  margin-bottom: 4px;
}

.login-sub {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.5;
}

.login-link {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 14px;
  padding: 8px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
  transition: color var(--t);
}

.login-link:hover {
  color: var(--brand-mid);
}

/* Servidor identificado no cadastro */
.server-identified {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--success-bg);
  border: 1px solid #86efac;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.server-identified svg {
  flex-shrink: 0;
  color: var(--success);
}

.server-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
}

.server-mat {
  font-size: 12px;
  color: var(--muted);
}

/* ═══════════════════════════════════════════
   FORM FIELDS
═══════════════════════════════════════════ */
.field-group {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-mid);
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  height: 46px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  padding: 0 14px;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}

.field-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(6, 95, 70, .1);
}

.field-input::placeholder {
  color: var(--muted-light);
}

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-wrap .field-input {
  padding-right: 44px;
}

.field-eye {
  position: absolute;
  right: 12px;
  color: var(--muted);
  display: flex;
  padding: 4px;
  cursor: pointer;
}

.field-eye:hover {
  color: var(--brand);
}

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn-primary,
.btn-primary-full {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--r-sm);
  transition: background var(--t), transform var(--t), box-shadow var(--t);
}

.btn-primary-full {
  width: 100%;
  height: 48px;
  font-size: 15px;
  margin-top: 4px;
}

.btn-primary:hover:not(:disabled),
.btn-primary-full:hover:not(:disabled) {
  background: var(--brand-mid);
  box-shadow: 0 4px 16px rgba(6, 95, 70, .25);
  transform: translateY(-1px);
}

.btn-primary:active,
.btn-primary-full:active {
  transform: none;
  box-shadow: none;
}

.btn-primary:disabled,
.btn-primary-full:disabled {
  opacity: .45;
  transform: none;
  box-shadow: none;
}

.btn-submit {
  position: relative;
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 9px;
  margin-top: 18px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #4f8f46 0%, #639b56 52%, #7cb66b 100%);
  color: #f3f3f3;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(48, 106, 53, 0.35);
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
  isolation: isolate;
}

.btn-submit::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, rgba(35, 78, 39, 0.08) 0%, rgba(35, 78, 39, 0.52) 100%);
  transform: translateX(-102%);
  transition: transform 0.35s ease;
  z-index: -1;
}

.btn-submit:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 20px rgba(48, 106, 53, 0.48);
  filter: saturate(1.08);
}

.btn-submit:hover::before {
  transform: translateX(0);
}

.btn-submit:active {
  transform: translateY(0) scale(0.995);
  box-shadow: 0 5px 10px rgba(48, 106, 53, 0.33);
}

.btn-submit:focus-visible {
  outline: 2px solid rgba(161, 224, 149, 0.9);
  outline-offset: 2px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--brand-light);
  transition: background var(--t);
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--brand-light);
  color: var(--brand);
}

.btn-danger-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--r-sm);
  border: 1px solid #fca5a5;
  transition: background var(--t);
  flex-shrink: 0;
}

.btn-danger-sm:hover {
  background: #fee2e2;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .75);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  transition: background var(--t), color var(--t);
  white-space: nowrap;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════ */
.alert {
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  line-height: 1.5;
}

.alert-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fca5a5;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #86efac;
}

.alert-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #fcd34d;
}

/* ═══════════════════════════════════════════
   APP SHELL / HEADER
═══════════════════════════════════════════ */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 58px;
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
  flex-shrink: 0;
}

.portal-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.portal-header-logo {
  height: 65px;
  width: auto;
  object-fit: contain;
  filter: brightness(1.1);
  flex-shrink: 0;
}

.portal-header-title {
  display: none;
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  white-space: nowrap;
}

.portal-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.portal-header-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.portal-header-name {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-header-sec {
  color: rgba(255, 255, 255, .6);
  font-size: 11px;
}

/* ═══════════════════════════════════════════
   TABS
═══════════════════════════════════════════ */
.portal-tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 58px;
  z-index: 90;
  box-shadow: var(--sh-sm);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.portal-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  justify-content: center;
  padding: 14px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  border-bottom: 3px solid transparent;
  transition: color var(--t), border-color var(--t);
  white-space: nowrap;
  position: relative;
  min-width: 100px;
}

.tab-btn:hover {
  color: var(--brand);
}

.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.tab-badge {
  position: static;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 100px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   CONTENT / TABS
═══════════════════════════════════════════ */
.portal-content {
  flex: 1;
  padding: 20px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeUp .2s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ═══════════════════════════════════════════
   MISC HELPERS
═══════════════════════════════════════════ */
.section-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 12px;
  margin-top: 4px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.text-muted {
  color: var(--muted);
  font-size: 13px;
}

.hint-box {
  background: var(--brand-soft);
  border: 1px solid var(--brand-light);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--brand);
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.hint-box svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════
   EVENTS GRID
═══════════════════════════════════════════ */
.events-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.event-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
  position: relative;
}

.event-card:hover:not(.sold-out) {
  /*border-color: var(--brand); */
  transform: translateY(-2px);
  box-shadow: var(--sh);
}

.event-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, .15);
}

.event-card.confirmed {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .12);
}

.event-card.sold-out {
  opacity: .65;
  cursor: not-allowed;
  border-color: var(--danger);
}

.event-card-img {
  aspect-ratio: 6 / 5;
  height: auto;
  background: var(--subtle);
  position: relative;
  overflow: hidden;
}

.event-card-img img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.sold-out-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}

.sold-out-pill {
  background: var(--danger);
  color: #fff;
  width: 100%;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: calc(var(--r) - 2px) calc(var(--r) - 2px) 0 0;
}

.event-card-check {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  min-height: 30px;
  padding: 8px 12px;
  border-radius: calc(var(--r) - 2px) calc(var(--r) - 2px) 0 0;
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.event-card-check svg {
  flex-shrink: 0;
}

.event-card-body {
  padding: 12px;
}

.event-card-date {
  font-size: 10px;
  font-weight: 800;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 3px;
}

.event-card-name {
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.3;
}

.event-card-place {
  font-size: 11px;
  color: var(--muted);
}

.event-capacity {
  margin-top: 10px;
}

.event-capacity-head {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.event-capacity-track {
  height: 7px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--subtle);
}

.event-capacity-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--success));
}

.event-card.sold-out .event-capacity-track span {
  background: var(--danger);
}

/* Banner evento confirmado */
.confirmed-banner {
  background: linear-gradient(135deg, #064e3b, #047857);
  border-radius: var(--r);
  padding: 18px 20px;
  color: #fff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.confirmed-banner-info {
  min-width: 0;
  flex: 1;
}

.confirmed-banner-info h3 {
  font-size: 17px;
  font-weight: 900;
  margin-bottom: 4px;
}

.confirmed-banner-info p {
  font-size: 13px;
  color: rgba(255, 255, 255, .8);
}

.confirmed-banner-badge {
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: var(--r-sm);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   TICKETS / QR CODES
═══════════════════════════════════════════ */
.ticket-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--sh-sm);
}

.ticket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.ticket-type-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticket-type-servidor {
  background: var(--success-bg);
  color: var(--success);
}

.ticket-type-convidado {
  background: #e0f2fe;
  color: #0284c7;
}

.ticket-type-used {
  background: var(--warning-bg);
  color: var(--warning);
}

.ticket-body {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 18px;
}

.ticket-qr {
  flex-shrink: 0;
}

.ticket-qr img {
  width: 130px;
  height: 130px;
  border: 3px solid var(--border);
  border-radius: var(--r-sm);
  display: block;
}

.ticket-info {
  flex: 1;
  min-width: 0;
}

.ticket-name {
  font-size: 16px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 4px;
}

.ticket-event {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.ticket-token {
  font-size: 11px;
  font-family: monospace;
  color: var(--muted-light);
  word-break: break-all;
}

.ticket-checkin-token {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid #86efac;
  border-radius: var(--r-sm);
  background: #ecfdf5;
  color: #065f46;
}

.ticket-checkin-token span {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.ticket-checkin-token strong {
  font-size: 19px;
  line-height: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .08em;
  color: var(--ink);
}

.ticket-checkin-token small {
  max-width: 280px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}

.ticket-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.ticket-action-btn {
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  line-height: 1;
}

.ticket-action-token,
.ticket-action-token:hover {
  background: #F59E0B;
  border-color: #F59E0B;
  color: #fff;
}

.ticket-action-download,
.ticket-action-download:hover {
  background: #064e3b;
  border-color: #064e3b;
  color: #fff;
}

/* ═══════════════════════════════════════════
   GUESTS
═══════════════════════════════════════════ */
.guest-counter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--subtle);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

.guest-counter-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.guest-counter-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 4px;
  transition: width .4s ease;
}

.guest-counter-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.guest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  box-shadow: var(--sh-sm);
}

.guest-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 18px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guest-info {
  flex: 1;
  min-width: 0;
}

.guest-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.guest-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
}

.guest-cpf {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.add-guest-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--sh-sm);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ═══════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-state svg {
  color: var(--muted-light);
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-mid);
}

.empty-state p {
  font-size: 13px;
  max-width: 280px;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════
   TOAST
═══════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 16px;
  box-shadow: var(--sh-lg);
  min-width: 260px;
  max-width: 340px;
  pointer-events: auto;
  animation: toastIn .2s ease;
}

.toast.leaving {
  animation: toastOut .2s ease forwards;
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast.success .toast-icon {
  background: var(--success-bg);
  color: var(--success);
}

.toast.error .toast-icon {
  background: var(--danger-bg);
  color: var(--danger);
}

.toast.info .toast-icon {
  background: #e0f2fe;
  color: #0284c7;
}

.toast-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.toast-msg {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.97);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(10px) scale(.97);
  }
}

/* ═══════════════════════════════════════════
   LOADING
═══════════════════════════════════════════ */
/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(5px);
}

.portal-modal {
  width: min(100%, 440px);
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--sh-lg);
  overflow: hidden;
  animation: modalIn .18s ease;
}

.modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 82px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-mid));
}

.modal-icon.warning {
  background: #ef4444;
}

.modal-icon svg {
  width: 30px;
  height: 30px;
  padding: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .08);
}

.modal-icon span {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .08em;
}

.modal-content {
  padding: 18px 20px 0;
}

.modal-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 6px;
}

.portal-modal h2 {
  color: var(--ink);
  font-size: 21px;
  line-height: 1.2;
  font-weight: 900;
}

.modal-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.modal-warning {
  margin: 14px 0 0;
  color: #fff;
  background: #ef4444;
  border-color: #ef4444;
  font-weight: 900;
}

.modal-warning svg {
  color: #fff;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 20px 20px;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  height: 40px;
}

.modal-actions .btn-primary {
  border: 0;
  outline: 0;
  box-shadow: none;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 640px) {
  .events-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .ticket-body {
    flex-direction: column;
  }

  .ticket-qr img {
    width: 100%;
    height: auto;
    max-width: 200px;
  }

  .ticket-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .ticket-action-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .portal-content {
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .portal-header-title {
    display: none;
  }

  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast {
    min-width: unset;
    max-width: 100%;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn-primary,
  .modal-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .ticket-actions {
    gap: 6px;
  }

  .ticket-action-btn {
    height: 32px;
    padding: 0 10px;
    font-size: 11px;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .events-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Dashboard refinado */
.portal-content {
  max-width: 1160px;
  padding: 24px;
}

.portal-dashboard {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dashboard-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background:
    linear-gradient(135deg, rgba(6, 95, 70, .94), rgba(4, 120, 87, .88)),
    url('/static/imagens/background-461.png') center/cover;
  color: #fff;
  box-shadow: var(--sh);
}

.dashboard-hero.is-confirmed {
  background:
    linear-gradient(135deg, rgba(6, 78, 59, .94), rgba(180, 83, 9, .76)),
    url('/static/imagens/background-461.png') center/cover;
}

.dashboard-hero-copy {
  max-width: 720px;
  min-width: 0;
}

.dashboard-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, .78);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.dashboard-hero h1 {
  font-size: 30px;
  line-height: 1.12;
  font-weight: 900;
  margin-bottom: 8px;
}

.dashboard-hero p {
  max-width: 620px;
  color: rgba(255, 255, 255, .86);
  font-size: 14px;
}

.dashboard-hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, .2);
}

.status-dot.ok {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .22);
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(140px, .7fr) minmax(140px, .7fr);
  gap: 14px;
}

.summary-card {
  min-width: 0;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--sh-sm);
}

.summary-card.compact {
  align-items: flex-start;
}

.summary-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.summary-card strong {
  display: block;
  width: 100%;
  margin-top: 10px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.15;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.summary-card.compact strong {
  font-size: 34px;
}

.summary-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.confirmed-banner {
  margin-bottom: 0;
  box-shadow: var(--sh-sm);
}

.confirmed-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid #bbf7d0;
  border-radius: var(--r);
  background: #f0fdf4;
}

.panel-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--success);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.confirmed-panel h2 {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
}

.confirmed-panel p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.confirmed-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
  margin-bottom: 12px;
}

.section-heading .section-label {
  margin: 0 0 4px;
}

.section-heading h2 {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
}

.section-heading>span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-events-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.event-card {
  min-width: 0;
  border-width: 1px;
}

.event-card-img {
  height: auto;
}

.event-card-body {
  min-height: 142px;
  display: flex;
  flex-direction: column;
}

.event-card-name {
  font-size: 16px;
}

.event-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.event-card-footer .danger {
  color: var(--danger);
}

.event-card-footer strong {
  color: var(--success);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

@media (max-width: 980px) {

  .login-logo-img,
  .portal-header-logo {
    height: 55px;
  }

  .portal-content {
    max-width: 820px;
  }

  .dashboard-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-events-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .login-banner {
    height: 54px;
  }

  .portal-content {
    padding: 14px;
  }

  .portal-header {
    padding: 0 14px;
  }

  .btn-logout {
    gap: 5px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .portal-header-info {
    display: none;
  }

  .portal-tabs {
    top: 58px;
  }

  .tab-btn {
    flex: 0 0 auto;
    min-width: 118px;
    padding: 12px 12px;
  }

  .dashboard-hero {
    flex-direction: column;
    padding: 18px;
  }

  .dashboard-hero h1 {
    font-size: 24px;
  }

  .dashboard-hero-status {
    align-self: flex-start;
  }

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

  .summary-card {
    min-height: 104px;
  }

  .summary-card.compact strong {
    font-size: 28px;
  }

  .confirmed-banner {
    align-items: center;
    gap: 10px;
    padding: 14px;
  }

  .confirmed-banner-info h3 {
    font-size: 15px;
    line-height: 1.25;
  }

  .confirmed-banner-info p {
    font-size: 11px;
    line-height: 1.35;
  }

  .confirmed-banner-badge {
    padding: 7px 10px;
    font-size: 11px;
  }

  .confirmed-panel,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .confirmed-actions {
    width: 100%;
    justify-content: stretch;
  }

  .confirmed-actions .btn-secondary {
    flex: 1 1 180px;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .login-page {
    padding: 12px;
  }

  .login-banner {
    height: 50px;
  }

  .login-form-body {
    padding: 20px;
  }

  .dashboard-hero h1 {
    font-size: 22px;
  }

  .event-card-img {
    height: auto;
  }

  .btn-danger-sm {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }
}