:root {
  --bg: #030303;
  --bg-strong: #0b0b0f;
  --surface: rgba(12, 12, 18, 0.86);
  --surface-strong: rgba(22, 22, 30, 0.95);
  --text: #ffffff;
  --muted: #c9c9d4;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #ff2bbf;
  --accent-dark: #b10078;
  --accent-soft: rgba(255, 43, 191, 0.18);
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(255, 43, 191, 0.28), transparent 22%),
    radial-gradient(circle at left center, rgba(120, 30, 255, 0.14), transparent 24%),
    radial-gradient(circle at bottom center, rgba(255, 43, 191, 0.1), transparent 28%),
    linear-gradient(180deg, #000000 0%, var(--bg) 48%, var(--bg-strong) 100%);
}

body.modal-open {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, black 35%, transparent 100%);
}

.shell {
  width: min(100%, 100%);
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.hero,
.panel,
.actions {
  position: relative;
  z-index: 1;
}

.hero {
  overflow: hidden;
  padding: 32px 24px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(12, 12, 16, 0.94), rgba(8, 8, 12, 0.9));
  box-shadow: var(--shadow);
  text-align: center;
}

.hero--compact {
  padding-top: 24px;
  padding-bottom: 24px;
}

.hero__glow {
  position: absolute;
  inset: -20% auto auto 50%;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 43, 191, 0.34), transparent 68%);
  transform: translateX(-50%);
}

.hero__logo {
  display: block;
  width: 136px;
  margin: 0 auto 16px;
  filter:
    drop-shadow(0 0 10px rgba(255, 43, 191, 0.6))
    drop-shadow(0 0 26px rgba(255, 43, 191, 0.38));
}

.hero__eyebrow,
.section-label {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(255, 43, 191, 0.38);
}

h1,
h2 {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-shadow: 0 0 18px rgba(255, 43, 191, 0.26);
}

h1 {
  font-size: clamp(2.5rem, 8vw, 4.25rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 0.98;
}

.hero__copy,
.panel__copy,
#nfc-status,
.beneficio p,
.empty,
.form-message {
  color: var(--muted);
}

.hero__copy {
  margin: 16px 0 0;
  font-size: 1rem;
  line-height: 1.55;
  max-width: none;
}

.panel {
  margin-top: 18px;
  padding: 24px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel__header {
  margin-bottom: 18px;
  text-align: center;
}

.beneficios {
  display: grid;
  gap: 12px;
}

.beneficio {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  cursor: pointer;
}

.beneficio h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #ffffff;
}

.beneficio p {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.45;
}

.beneficio__meta {
  display: grid;
  gap: 4px;
  margin-top: 14px;
}

.beneficio__meta strong {
  color: var(--accent);
  font-size: 0.92rem;
}

.beneficio__meta span {
  color: var(--muted);
  font-size: 0.85rem;
}

.account-card {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.account-card p {
  margin: 0 0 10px;
  line-height: 1.45;
}

.account-card p:last-child {
  margin-bottom: 0;
}

.portal-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.portal-menu__item {
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font: inherit;
  font-weight: 800;
}

.portal-menu__item.is-active {
  background: linear-gradient(135deg, rgba(255, 43, 191, 0.96) 0%, rgba(177, 0, 120, 0.96) 100%);
  box-shadow: 0 0 22px rgba(255, 43, 191, 0.24);
}

.portal-view[hidden] {
  display: none;
}

.portal-title {
  margin: 0 0 12px;
  font-size: 1.2rem;
  color: var(--accent);
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.field select,
.field textarea {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 0 16px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.field textarea {
  min-height: 120px;
  padding: 14px 16px;
  resize: vertical;
}

.receipt-preview {
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.receipt-preview img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.receipt-result {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.receipt-result-card {
  margin-top: 16px;
}

.receipt-result__details {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.receipt-result__details p {
  margin: 0;
}

.receipt-sale {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.receipt-sale__head,
.receipt-sale__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.receipt-sale__label {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.receipt-sale__value {
  font-size: 1.35rem;
  color: var(--accent);
}

.receipt-sale__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.receipt-sale__total span {
  color: var(--muted);
}

.receipt-sale__total strong {
  font-size: 1.2rem;
}

.receipt-lunch {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 43, 191, 0.08);
  border: 1px solid rgba(255, 43, 191, 0.18);
}

.receipt-lunch__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.receipt-accordion {
  margin-top: 12px;
}

.receipt-accordion__toggle {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
  font: inherit;
  font-weight: 700;
}

.receipt-accordion__panel {
  margin-top: 10px;
}

.receipt-items {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.receipt-items__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.94rem;
}

.receipt-items__main {
  display: grid;
  gap: 4px;
}

.receipt-items__name {
  font-weight: 700;
}

.receipt-items__meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.receipt-items__total {
  white-space: nowrap;
  font-weight: 800;
}

.progress-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.progress-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-bar__fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 43, 191, 0.96) 0%, rgba(177, 0, 120, 0.96) 100%);
  box-shadow: 0 0 20px rgba(255, 43, 191, 0.32);
}

.calendar-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.calendar-history {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.calendar-history__list {
  display: grid;
  gap: 10px;
}

.calendar-history__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.calendar-history__item span {
  color: var(--muted);
  text-align: right;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-grid__label {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.calendar-grid__day {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.calendar-grid__day--empty {
  background: transparent;
  border-color: transparent;
}

.calendar-grid__day--marked {
  background: linear-gradient(135deg, rgba(255, 43, 191, 0.96) 0%, rgba(177, 0, 120, 0.96) 100%);
  box-shadow: 0 0 18px rgba(255, 43, 191, 0.24);
}

.calendar-grid__day--today {
  outline: 1px solid rgba(255, 255, 255, 0.45);
}

.actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.action {
  min-height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 16px 18px;
  font: inherit;
  font-weight: 800;
  color: #ffffff;
  background: rgba(15, 15, 22, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.action--primary,
.action--secondary {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(255, 43, 191, 0.96) 0%, rgba(177, 0, 120, 0.96) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 43, 191, 0.18),
    0 0 24px rgba(255, 43, 191, 0.32);
}

.action--ghost {
  background: rgba(255, 255, 255, 0.06);
}

.action:disabled,
.action[aria-disabled="true"] {
  opacity: 0.56;
  pointer-events: none;
}

.action:active {
  transform: translateY(1px);
}

.panel--form {
  animation: reveal 220ms ease;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: end;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
}

.modal__card {
  position: relative;
  margin: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  max-height: min(88vh, 760px);
  overflow-y: auto;
  z-index: 1;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
}

.nfc-box {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid rgba(255, 43, 191, 0.16);
}

.nfc-box p {
  margin: 6px 0 0;
  line-height: 1.45;
}

.nfc-actions {
  display: grid;
  gap: 10px;
}

.nfc-debug {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.camera-box {
  margin: 0 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  position: relative;
}

.qr-video {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.camera-box::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(62vw, 240px);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 43, 191, 0.92);
  border-radius: 18px;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.18),
    0 0 22px rgba(255, 43, 191, 0.32);
  pointer-events: none;
}

.nfc-debug strong {
  display: block;
  margin-bottom: 10px;
}

.nfc-debug pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #f7d7ef;
}

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 0 16px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.field input:focus {
  outline: 2px solid rgba(255, 43, 191, 0.36);
  outline-offset: 2px;
}

.field input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.action--submit {
  margin-top: 4px;
}

.empty,
.form-message {
  margin: 16px 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.form-message[data-state="success"] {
  color: #89ffb0;
}

.form-message[data-state="error"] {
  color: #ff8fb2;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 520px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 43, 191, 0.16);
  color: #ffffff;
  border: 1px solid rgba(255, 43, 191, 0.24);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  z-index: 10;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 640px) {
  .shell {
    max-width: 640px;
    padding-top: 40px;
  }

  .actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .nfc-box {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .nfc-actions {
    min-width: 190px;
  }

  .modal {
    align-items: center;
    justify-items: center;
    padding: 20px;
  }

  .modal__card {
    width: min(100%, 640px);
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 560px) {
  .portal-menu {
    grid-template-columns: 1fr;
  }
}
