@font-face {
  font-family: 'Source Sans Pro';
  src: url('../fonts/SourceSansPro-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Source Sans Pro';
  src: url('../fonts/SourceSansPro-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Source Sans Pro';
  src: url('../fonts/SourceSansPro-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Cinema Sunday';
  src: url('../fonts/cinema sunday.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}

:root {
  --sand: #d9c7ae;
  --sand-dark: #9e8366;
  --paper: #080807;
  --text: #c2a887;
  --text-strong: #9d7d58;
  --background: #000;
  --accent: #e8d5ba;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  /* align-items: center; */
  padding: 30px 16px;
}

.page-wrapper {
  width: min(420px, 100%);
}

.card {
  background-color: var(--paper);
  background-image: url('../images/Moldura.png');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(73, 53, 33, 0.12);
  padding: clamp(32px, 8vw, 48px) clamp(24px, 5vw, 40px) clamp(32px, 10vw, 64px);
  position: relative;
}

.logo {
  width: 160px;
  margin: 0 auto 12px;
  display: block;
}

.title-image {
  width: 100%;
  display: block;
  margin: 12px auto 24px;
}

.subtitle {
  font-family: 'Cinema Sunday', 'Source Sans Pro', serif;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  text-align: center;
  color: var(--sand-dark);
  margin-bottom: 12px;
}

.message {
  text-align: center;
  font-size: 1.03rem;
  line-height: 1.6;
  margin: 0 auto 32px;
  color: var(--text);
}

.message img {
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

.message strong {
  color: var(--text-strong);
  font-weight: 600;
}

.status-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 50;
}

.status-modal.visible {
  opacity: 1;
  visibility: visible;
}

.status-modal__content {
  background: var(--paper);
  padding: 24px;
  border-radius: 16px;
  max-width: 320px;
  width: calc(100% - 60px);
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(157, 125, 88, 0.3);
}

.status-modal.error .status-modal__content {
  border-color: #e08a7c;
}

.status-modal__content p {
  margin: 0 0 16px;
  color: var(--text-strong);
  font-weight: 600;
}

.status-modal__close {
  background: var(--sand-dark);
  border: none;
  color: #fff;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.qr-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qr-frame {
  width: min(280px, 80vw);
  aspect-ratio: 1 / 1.02;
  background-image: url('../images/Fundo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.qr-content {
  width: 70%;
  aspect-ratio: 1 / 1;
  border: 2px dashed rgba(158, 131, 102, 0.6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.25);
  position: relative;
}

.qr-caption {
  font-size: 0.9rem;
  text-align: center;
  color: var(--text-strong);
  margin: 0;
}

#qr-reader {
  width: 100%;
  height: 100%;
  position: relative;
}

#qr-reader video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9);
}

#qr-reader canvas {
  display: none;
}

#qr-reader__dashboard,
#qr-reader__dashboard_section_swaplink,
#qr-reader__dashboard_section_csr,
#qr-reader__dashboard_section_stop {
  display: none !important;
}

.scan-status {
  color: var(--accent);
  font-size: 0.9rem;
  min-height: 1.2em;
  text-align: center;
}

footer {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(157, 125, 88, 0.8);
  margin-top: 24px;
}

@media (min-width: 480px) {
  body {
    padding: 40px 0;
  }

  .message {
    font-size: 1.15rem;
  }
}
