/* ==============================================================================
   ESTILOS - PÁGINA DE CHECK-IN PRESENCIAL (MARINA EXPERIENCE)
   Arquitetura: MOBILE-FIRST RADICAL
   Identidade: Fundo Claro, Azul-Marinho Náutico, Verde Castrol, Alta Performance
   ============================================================================== */

:root {
  --color-primary-navy: #0b1e36;
  --color-navy-dark: #071526;
  --color-green-castrol: #00823b;
  --color-green-hover: #006b30;
  --color-green-light: #e8f7ee;
  --color-green-border: #a7f3d0;
  --color-text-dark: #1e293b;
  --color-text-muted: #64748b;
  --color-bg-light: #f8fafc;
  --color-border: #e2e8f0;
  --color-white: #ffffff;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px rgba(11, 30, 54, 0.08);
  --shadow-lg: 0 20px 45px rgba(11, 30, 54, 0.16);
  --shadow-cta: 0 8px 24px rgba(0, 130, 59, 0.35);

  --font-main: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset Básico */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: var(--font-main);
  background-color: var(--color-white);
  color: var(--color-text-dark);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ==============================================================================
   1. CABEÇALHO COMPACTO MOBILE (SEM DISTRAÇÕES)
   ============================================================================== */
.checkin-header {
  position: relative;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
}

.checkin-header-logo img {
  height: 38px;
  width: auto;
  display: block;
}

.checkin-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--color-green-light);
  color: var(--color-green-castrol);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-green-border);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--color-green-castrol);
  border-radius: 50%;
  animation: pulse-live 1.8s infinite ease-in-out;
}

@keyframes pulse-live {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* ==============================================================================
   2. HERO PRINCIPAL (PADRÃO MOBILE: TÍTULO NO TOPO + CARD BRANCO NA BASE)
   ============================================================================== */
.checkin-wrapper {
  position: relative;
  min-height: calc(100vh - 63px);
  min-height: calc(100dvh - 63px);
  display: flex;
  flex-direction: column;
  background-color: #f8fafc;
  overflow: hidden;
}

/* Imagem de Fundo Oficial: Especialista Castrol ampliado e mais centralizado */
.checkin-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('public/bg-checkin-mobile.png');
  background-repeat: no-repeat;
  background-position: 58% 16%;
  background-size: 115% auto;
  z-index: 1;
}

/* Sombreado Esfumaçado Branco:
   - No topo esquerdo para dar leitura perfeita ao título ampliado
   - Na base para suavizar e cobrir os óleos antes do card */
.checkin-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse 85% 48% at 8% 12%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.78) 42%, transparent 75%),
    linear-gradient(to top, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.85) 20%, rgba(255, 255, 255, 0.35) 35%, transparent 48%);
  z-index: 2;
  pointer-events: none;
}

.checkin-container {
  position: relative;
  z-index: 5;
  width: 100%;
  min-height: calc(100vh - 63px);
  min-height: calc(100dvh - 63px);
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 12px));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

/* Topo / Lado Esquerdo: Título com Maior Destaque */
.checkin-header-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 320px;
  text-align: left;
}

.checkin-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.checkin-eyebrow-line {
  display: inline-block;
  width: 24px;
  height: 3px;
  background-color: var(--color-green-castrol);
  border-radius: 2px;
}

.checkin-eyebrow-text {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary-navy);
}

.checkin-title {
  font-size: 2.7rem;
  font-weight: 900;
  line-height: 1.04;
  color: var(--color-primary-navy);
  letter-spacing: -0.03em;
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.85);
}

.checkin-title .highlight-green {
  color: var(--color-green-castrol);
  display: block;
}

/* Card Branco Compacto na Base (Cobrindo os óleos) */
.checkin-action-card {
  background-color: #ffffff;
  border-radius: 20px;
  padding: 16px 16px 14px;
  box-shadow: 0 10px 30px rgba(11, 30, 54, 0.16);
  border: 1px solid rgba(226, 232, 240, 0.95);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkin-desc {
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.4;
  margin: 0;
  text-align: left;
}

.btn-checkin-main {
  width: 100%;
  min-height: 52px;
  background: linear-gradient(135deg, #008f41, var(--color-green-castrol));
  color: var(--color-white);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0, 130, 59, 0.38);
  transition: var(--transition);
  margin: 0;
}

.btn-checkin-main:active {
  transform: scale(0.98);
}

.btn-checkin-main i {
  font-size: 1.2rem;
}

/* Informações Resumidas do Evento (Item 8 do PRD) */
.checkin-event-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 8px 10px;
  gap: 6px;
}

.event-info-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.event-info-pill i {
  color: var(--color-green-castrol);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.info-pill-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.info-pill-main {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--color-primary-navy);
  white-space: nowrap;
}

.info-pill-sub {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.event-info-divider {
  width: 1px;
  height: 22px;
  background-color: var(--color-border);
  flex-shrink: 0;
}

.checkin-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-primary-navy);
  margin-bottom: 8px;
}

.checkin-info-row:last-child {
  margin-bottom: 0;
}

.checkin-info-row i {
  color: var(--color-green-castrol);
  width: 18px;
  text-align: center;
}

/* ==============================================================================
   3. MODAL / BOTTOM SHEET MOBILE (QUASE FULLSCREEN)
   ============================================================================== */
.checkin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(7, 21, 38, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: flex-end; /* Bottom sheet no mobile */
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.checkin-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.checkin-modal-card {
  position: relative;
  background-color: var(--color-white);
  width: 100%;
  max-width: 520px;
  border-radius: 24px 24px 0 0; /* Estilo Bottom Sheet mobile */
  box-shadow: var(--shadow-lg);
  padding: 30px 22px 28px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 92vh;
  overflow-y: auto;
}

.checkin-modal-overlay.active .checkin-modal-card {
  transform: translateY(0);
}

/* Barra de puxar (Drag Handle) no topo do Bottom Sheet */
.modal-drag-handle {
  width: 44px;
  height: 4px;
  background-color: #cbd5e1;
  border-radius: 2px;
  margin: 0 auto 18px;
}

/* Botão Fechar */
.checkin-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #f1f5f9;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 1.15rem;
  cursor: pointer;
}

/* Cabeçalho do Modal */
.modal-icon-badge {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  background-color: var(--color-green-light);
  color: var(--color-green-castrol);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
}

.modal-icon-badge.success {
  background-color: #d1fae5;
  color: #059669;
}

.modal-icon-badge.warning {
  background-color: #fef3c7;
  color: #d97706;
}

.checkin-modal-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--color-primary-navy);
  text-align: center;
  margin-bottom: 6px;
  line-height: 1.2;
}

.checkin-modal-subtitle {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 22px;
  line-height: 1.45;
}

/* Inputs e Formulários */
.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-primary-navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--color-green-castrol);
  font-size: 1.25rem;
  pointer-events: none;
}

.form-input-lg {
  width: 100%;
  height: 56px;
  padding: 0 16px 0 50px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary-navy);
  background-color: #fafafa;
  transition: var(--transition);
}

.form-input-lg:focus {
  outline: none;
  border-color: var(--color-green-castrol);
  background-color: var(--color-white);
  box-shadow: 0 0 0 4px rgba(0, 130, 59, 0.12);
}

/* Botões do Modal */
.btn-action-primary {
  width: 100%;
  height: 54px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #008f41, var(--color-green-castrol));
  color: var(--color-white);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-cta);
  transition: var(--transition);
  margin-top: 10px;
}

.btn-action-primary:active {
  transform: scale(0.98);
}

.btn-action-primary:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-action-outline {
  width: 100%;
  height: 50px;
  border-radius: var(--radius-md);
  background-color: transparent;
  color: var(--color-green-castrol);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1.5px solid var(--color-green-castrol);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.btn-action-outline:hover {
  background-color: var(--color-green-light);
}

/* Card do Participante Encontrado */
.checkin-participant-card {
  background-color: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 18px;
  text-align: left;
}

.checkin-participant-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #065f46;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #bbf7d0;
}

.checkin-participant-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  color: #1e293b;
}

.checkin-participant-field:last-child {
  margin-bottom: 0;
}

.checkin-participant-field i {
  color: var(--color-green-castrol);
  width: 20px;
  text-align: center;
}

.checkin-confirm-question {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--color-primary-navy);
  text-align: center;
  margin: 14px 0 12px;
}

/* Card de Boas-Vindas Sucesso */
.checkin-welcome-card {
  background: linear-gradient(135deg, #f0fdf4, #e8f7ee);
  border: 1.5px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.checkin-welcome-tag {
  display: inline-block;
  background-color: var(--color-green-castrol);
  color: var(--color-white);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
}

.checkin-welcome-name {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--color-primary-navy);
  margin-bottom: 4px;
}

.checkin-welcome-sub {
  font-size: 0.88rem;
  color: #065f46;
  font-weight: 600;
}

.modal-back-action {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-bottom: 12px;
}

/* Alertas */
.checkin-alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.checkin-alert.error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.checkin-alert.warning {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Spinner */
.spinner-sm {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: var(--color-white);
  animation: spin 0.8s linear infinite;
}

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

/* ==============================================================================
   4. ADAPTAÇÃO TABLET E DESKTOP (SECUNDÁRIO)
   ============================================================================== */
@media (min-width: 769px) {
  .checkin-wrapper {
    min-height: calc(100vh - 72px);
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding-left: 8%;
    background-color: #ffffff;
    background-image: url('public/bg-confirmacao-presenca.png');
    background-repeat: no-repeat;
    background-position: right center;
    background-size: cover;
  }

  .checkin-hero-visual {
    display: none; /* No desktop usa o background panorâmico */
  }

  .checkin-action-card {
    margin-top: 0;
    max-width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    padding: 38px 34px;
    background-color: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    flex-grow: 0;
  }

  .checkin-drag-pill {
    display: none;
  }

  .checkin-header-logo img {
    height: 44px;
  }

  .checkin-title {
    font-size: 2.8rem;
  }

  .checkin-modal-overlay {
    align-items: center; /* Centralizado no desktop */
    padding: 24px;
  }

  .checkin-modal-card {
    border-radius: var(--radius-lg);
    padding: 36px 32px;
  }

  .modal-drag-handle {
    display: none;
  }
}
