/* ============================
   ROOT & VARIABILI
   ============================ */
:root {
  --bg-main: #050608;
  --bg-card: #111217;
  --gold: #d4af37;
  --gold-soft: #c9a233;
  --neon: #35ff8a;
  --text-main: #f5f5f5;
  --text-muted: #b0b3c0;
}

/* ============================
   RESET & BASE
   ============================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #14151c 0, #050608 55%);
  color: var(--text-main);
}

/* ============================
   PAGE WRAPPER
   ============================ */
.nfc-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

/* ============================
   INTRO SECTION
   ============================ */
.nfc-intro {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeInSoft 0.6s ease forwards;
  opacity: 0;
}

.nfc-intro h1 {
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 10px;
}

.nfc-intro .intro-text {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================
   GENERATOR SECTION
   ============================ */
.nfc-generator {
  margin-top: 24px;
  padding: 24px 20px;
  border-radius: 16px;
  background: radial-gradient(circle at top left, #15161f 0, #090a0f 60%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 0 24px rgba(53, 255, 138, 0.12);
  animation: fadeInSoft 0.6s ease forwards;
  opacity: 0;
}

.nfc-generator h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.generator-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.generator-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.generator-form input {
  flex: 1 1 220px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2b2d36;
  background: #050608;
  color: var(--text-main);
  font-size: 0.95rem;
}

.generator-form input::placeholder {
  color: #6c6f7d;
}

.generator-form input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
  outline: none;
  transition: 0.25s ease;
}

.generator-form button {
  flex: 0 0 auto;
}

/* ============================
   QR OUTPUT
   ============================ */
.qr-output {
  margin-bottom: 20px;
  text-align: center;
}

.qr-output.fade-out {
  animation: fadeOut 0.4s ease forwards;
}

#qr-code {
  display: inline-block;
  padding: 12px;
  border-radius: 12px;
  background: #050608;
  border: 1px solid rgba(53, 255, 138, 0.4);
  box-shadow: 0 0 18px rgba(53, 255, 138, 0.25);
  transition: transform 0.25s ease;
}

#qr-code:hover {
  transform: scale(1.03);
  box-shadow: 0 0 26px rgba(53, 255, 138, 0.35);
}

.qr-help {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ============================
   BUTTONS
   ============================ */
.btn-primary,
.btn-secondary,
.btn-close {
  cursor: pointer;
  border-radius: 999px;
  border: none;
  font-size: 0.95rem;
  padding: 10px 18px;
  transition: all 0.18s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0, var(--gold-soft) 60%);
  color: #050608;
  font-weight: 600;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.45);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary:not(:disabled) {
  animation: pulseGold 2.2s infinite ease-in-out;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.65);
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.97);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.55);
}

.btn-secondary {
  background: #111217;
  color: var(--text-main);
  border: 1px solid rgba(212, 175, 55, 0.5);
}

.btn-secondary:hover {
  background: #181924;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.btn-close {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid #2b2d36;
  padding: 8px 16px;
}

.btn-close:hover {
  color: var(--text-main);
  border-color: var(--gold);
  transform: scale(1.05);
  transition: 0.2s ease;
}

/* ============================
   NFC GUIDE
   ============================ */
.nfc-guide {
  margin-top: 48px;
  padding: 28px 22px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0b0c10 0, #050608 60%);
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 0 32px rgba(53, 255, 138, 0.18);
  animation: fadeInSoft 0.6s ease forwards;
  opacity: 0;
}

.nfc-guide h2 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--gold);
}

.nfc-guide ol {
  margin-left: 22px;
  font-size: 1rem;
  color: var(--text-muted);
}

.nfc-guide li {
  margin-bottom: 10px;
  line-height: 1.45;
}

/* ============================
   MODAL
   ============================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 8, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-overlay:not(.hidden) {
  animation: modalFade 0.35s ease forwards;
  opacity: 0;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  width: 100%;
  max-width: 420px;
  padding: 22px 20px 18px;
  border-radius: 18px;
  background: radial-gradient(circle at top, rgba(17, 18, 23, 0.95) 0, rgba(5, 6, 8, 0.98) 60%);
  border: 1px solid rgba(212, 175, 55, 0.7);
  box-shadow: 0 0 28px rgba(53, 255, 138, 0.25);
  animation: modalPop 0.35s ease forwards;
  transform: scale(0.92);
  opacity: 0;
}

.modal h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.modal-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

/* ============================
   FOOTER & RETURN BUTTON
   ============================ */
.nfc-footer {
  text-align: center;
  margin-top: 60px;
}

.btn-return {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 999px;
  background: #111217;
  color: var(--gold);
  border: 1px solid var(--gold);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 0 14px rgba(53, 255, 138, 0.25);
  transition: all 0.25s ease;
}

.btn-return:hover {
  background: var(--gold);
  color: #050608;
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.55);
  transform: translateY(-2px);
}

/* ============================
   ANIMAZIONI & KEYFRAMES
   ============================ */
@keyframes fadeInSoft {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.9); }
}

@keyframes qrGlow {
  from { box-shadow: 0 0 0px rgba(53,255,138,0.0); }
  to { box-shadow: 0 0 22px rgba(53,255,138,0.45); }
}

@keyframes pulseGold {
  0% { box-shadow: 0 0 12px rgba(212, 175, 55, 0.35); }
  50% { box-shadow: 0 0 22px rgba(212, 175, 55, 0.65); }
  100% { box-shadow: 0 0 12px rgba(212, 175, 55, 0.35); }
}

@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================
   RESPONSIVE DESIGN
   ============================ */
@media (max-width: 640px) {
  .nfc-generator {
    padding: 18px 14px;
  }

  .generator-form {
    flex-direction: column;
  }

  .modal {
    margin: 0 16px;
  }
}