:root {
  --primary-color: #2F4387;
  --accent-color: #2F4387;
  --text-dark: #1a1a2e;
  --text-muted: #6b7280;
  --bg-light: #f8fafc;
  --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  color: var(--text-dark);
}

body:has(.hero-fullscreen) {
  /* Permite rolagem vertical, mantendo apenas bloqueio horizontal */
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== HERO FULLSCREEN ===== */
.hero-fullscreen {
  position: relative;
  width: 100%;
  min-height: 100vh;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  /* Só esconde rolagem horizontal; vertical continua disponível */
  overflow-x: hidden;
}

/* Imagem de fundo (visível logo de cara) */
.hero-bg-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('../images/arninho_bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.25) 40%,
    rgba(0, 0, 0, 0.35) 100%
  );
  z-index: 1;
}

/* ===== TOP BAR ===== */
.hero-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  z-index: 10;
}

.topbar-right {
  margin-left: auto;
}

/* Top Actions (Login/Cadastro) */
.top-actions {
  display: flex;
  gap: 8px;
}

.btn-action {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-primary);
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.btn-action-outline {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
}

.btn-action-outline:hover {
  background: rgba(255, 255, 255, 0.2);
}

.user-welcome {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
}

#navNotLoggedIn, #navLoggedIn {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* FAQ Link */
.faq-link {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 8px 20px;
  border-radius: 24px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.faq-link:hover {
  background: rgba(255, 255, 255, 0.35);
  color: #fff;
  transform: translateY(-1px);
}

/* ===== HERO CENTER ===== */
.hero-center {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 460px;
  padding: 0 24px 0 72px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}

/* Logo Area */
.logo-area {
  text-align: left;
  width: 100%;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

.logo-patrocinadores {
  max-width: 260px;
  height: auto;
  margin-bottom: 50px;
}

.logo-roda {
  max-width: 320px;
  width: 100%;
  height: auto;
}

/* Headline */
.headline {
  text-align: left;
}

.headline h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.headline p {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

/* Search Area */
.search-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.search-box {
  width: 100%;
  display: flex;
  position: relative;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  border-radius: 14px;
  overflow: hidden;
  border: none;
  transition: box-shadow 0.3s ease;
}

.search-box:focus-within {
  box-shadow: 0 4px 30px rgba(47, 67, 135, 0.4);
}

.search-input {
  flex: 1;
  border: none;
  padding: 16px 20px;
  font-size: 1rem;
  font-family: var(--font-primary);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  outline: none;
  color: var(--text-dark);
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-btn {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 0 24px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  background: #24356D;
}

/* Separator */
.separator {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.separator::before,
.separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
}

.separator span {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  text-transform: lowercase;
}

/* Botão Facial */
.btn-facial {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-color) 0%, #1E2A57 100%);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 15px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(47, 67, 135, 0.4);
  font-family: var(--font-primary);
}

.btn-facial:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(47, 67, 135, 0.5);
}

/* Powered By */
.powered-by {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.powered-by span {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
  letter-spacing: 0.5px;
}

.powered-by svg {
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.powered-by:hover svg {
  opacity: 0.9;
}

.help-note {
  margin-top: 8px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  text-align: left;
  max-width: 100%;
}

.help-note a {
  color: #4D6FE0;
  font-weight: 600;
}

.help-note a:hover {
  color: #AFC3FF;
}

/* ===== MODALS ===== */
.modal-content {
  border-radius: 20px;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  border-bottom: 1px solid #e9ecef;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(135deg, var(--accent-color) 0%, #1E2A57 100%);
  color: white;
  padding: 20px 24px;
}

.modal-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.modal-header .btn-close:hover {
  opacity: 1;
}

/* Header claro (Central de ajuda) */
.modal-header-light {
  background: #ffffff;
  color: #111827;
}

.modal-header-light .btn-close {
  filter: none;
  opacity: 0.6;
}

.modal-header-light .btn-close:hover {
  opacity: 1;
}

.modal-title {
  font-weight: 600;
  font-size: 1.3rem;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 16px 24px;
}

/* Camera Container */
.camera-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#videoCamera,
#videoCameraReconhecimento {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.preview-foto {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.preview-foto img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.btn-refazer {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border: none;
  border-radius: 25px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.btn-refazer:hover {
  background: white;
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* Form Styles */
.form-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

/* Labels menores apenas na Central de ajuda */
#modalSuporte .form-label {
  font-size: 0.8rem;
}

.modal-body .form-control {
  border-radius: 10px;
  border: 1px solid #ced4da;
  padding: 12px 16px;
  font-size: 1rem;
  height: auto;
}

.modal-body .form-control:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.2rem rgba(47, 67, 135, 0.2);
}

.modal-body .form-select {
  font-size: 1rem;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #ced4da;
}

.modal-body .form-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.2rem rgba(47, 67, 135, 0.2);
}

.modal-body textarea {
  resize: vertical;
  min-height: 100px;
}

/* Botões do Modal */
.modal-footer .btn {
  border-radius: 25px;
  padding: 10px 24px;
  font-weight: 600;
}

.btn-primary {
  background: var(--accent-color);
  border: none;
}

.btn-primary:hover {
  background: #008a97;
}

.btn-primary:disabled {
  background: #6c757d;
  opacity: 0.6;
}

.btn-secondary {
  background: #6c757d;
  border: none;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-success {
  background: #28a745;
  border: none;
}

.btn-success:hover {
  background: #218838;
}

.btn-outline-primary {
  border-color: var(--accent-color);
  color: var(--accent-color);
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
  transform: translateY(-2px);
}

/* Lista de Galerias */
.galleries-list {
  max-height: 500px;
  overflow-y: auto;
  padding: 10px 0;
}

.gallery-item {
  display: flex;
  align-items: center;
  padding: 16px;
  margin-bottom: 12px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.gallery-item:hover {
  border-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(47, 67, 135, 0.15);
  transform: translateX(5px);
}

.gallery-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--accent-color) 0%, #1E2A57 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  flex-shrink: 0;
}

.gallery-info {
  flex: 1;
  margin-left: 16px;
  min-width: 0;
}

.gallery-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 8px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-details {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
  line-height: 1.6;
}

.gallery-count {
  display: inline-block;
  background: #f0fafb;
  color: var(--accent-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 8px;
}

.gallery-action {
  color: var(--accent-color);
  font-size: 20px;
  margin-left: 12px;
  flex-shrink: 0;
}

/* Accordion FAQ */
.accordion-item {
  border: 1px solid #e9ecef;
  border-radius: 10px !important;
  margin-bottom: 12px;
  overflow: hidden;
}

.accordion-button {
  background-color: #f8f9fa;
  color: #333;
  font-weight: 600;
  font-size: 1rem;
  padding: 16px 20px;
  border: none;
  box-shadow: none;
}

.accordion-button:not(.collapsed) {
  background-color: var(--accent-color);
  color: white;
  box-shadow: none;
}

.accordion-button:not(.collapsed)::after {
  filter: brightness(0) invert(1);
}

.accordion-button:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.25rem rgba(47, 67, 135, 0.2);
}

.accordion-button:hover {
  background-color: #e9ecef;
}

.accordion-button:not(.collapsed):hover {
  background-color: #24356D;
}

.accordion-body {
  padding: 20px;
  background-color: white;
  line-height: 1.6;
}

.accordion-body p { margin-bottom: 0; }
.accordion-body ol { margin-bottom: 0; }

.accordion-body a {
  color: var(--accent-color);
  text-decoration: underline;
  transition: color 0.3s ease;
}

.accordion-body a:hover {
  color: #24356D;
}

/* Abas da Central de Ajuda */
.help-tabs .nav-link {
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 18px;
  color: #495057;
}

.help-tabs .nav-link.active {
  background: var(--accent-color);
  color: #fff;
}

.help-tabs {
  background: #f3f4f6;
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

/* Suporte photos */
#previewFotoLocal img,
#previewFotoQrCode img {
  border: 2px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#btnRemoverFotoLocal,
#btnRemoverFotoQrCode {
  width: 100%;
}

/* Modal rows */
.modal-body .row {
  margin-left: 0;
  margin-right: 0;
}

.modal-body .col-4,
.modal-body .col-6,
.modal-body .col-8 {
  padding-left: 8px;
  padding-right: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
  .hero-bg-image {
    /* Desloca ~100px para a direita no mobile para enquadrar melhor o homem */
    background-position: calc(50% - 150px) center;
  }

  .hero-topbar {
    padding: 14px 16px;
  }

  .hero-center {
    padding: 0 20px;
    gap: 22px;
    align-items: center;
  }

  .logo-roda {
    max-width: 220px;
  }

  .headline h1 {
    font-size: 1.4rem;
  }

  .headline p {
    font-size: 0.85rem;
  }

  .search-input {
    padding: 14px 16px;
    font-size: 0.95rem;
  }

  .btn-facial {
    padding: 14px 18px;
    font-size: 0.95rem;
  }

  .btn-action {
    padding: 6px 14px;
    font-size: 0.8rem;
  }

  .faq-link {
    padding: 6px 14px;
    font-size: 0.8rem;
  }

  .help-floating {
    bottom: 16px;
    right: 16px;
  }

  .btn-help {
    padding: 10px 18px;
    font-size: 0.85rem;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .camera-container {
    max-width: 100%;
  }

  .modal-body .col-4,
  .modal-body .col-6,
  .modal-body .col-8 {
    padding-left: 4px;
    padding-right: 4px;
  }

  .accordion-button {
    font-size: 0.9rem;
    padding: 14px 16px;
  }

  .accordion-body {
    padding: 16px;
    font-size: 0.9rem;
  }
}

@media (max-width: 380px) {
  .hero-center {
    gap: 18px;
  }

  .logo-roda {
    max-width: 180px;
  }

  .headline h1 {
    font-size: 1.2rem;
  }
}

/* ===== LARGE SCREENS ===== */
@media (min-width: 1400px) {
  .hero-center {
    max-width: 520px;
  }

  .logo-roda {
    max-width: 360px;
  }

  .headline h1 {
    font-size: 2rem;
  }
}
