/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #0c0c0e;
  color: #ffffff;
  min-height: 100dvh;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* === Layout === */
#appContainer {
  width: 100%;
  max-width: 420px;
  padding: 1rem;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.hidden { display: none !important; }

/* === Steps === */
.step { display: none; width: 100%; }
.step.active { display: block; }

/* === Card === */
.step-content {
  background: #161618;
  border: 1px solid #28282b;
  border-radius: 24px;
  padding: 2rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  animation: fadeSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.step-content--center { text-align: center; }

/* === Logo === */
.logo {
  display: block;
  filter: drop-shadow(2px 0 0 #ffffff) 
          drop-shadow(-2px 0 0 #ffffff) 
          drop-shadow(0 2px 0 #ffffff) 
          drop-shadow(0 -2px 0 #ffffff)
          drop-shadow(1.4px 1.4px 0 #ffffff)
          drop-shadow(-1.4px -1.4px 0 #ffffff)
          drop-shadow(1.4px -1.4px 0 #ffffff)
          drop-shadow(-1.4px 1.4px 0 #ffffff);
}
.logo--large {
  width: 200px;
  height: auto;
  max-height: 90px;
  object-fit: contain;
  margin-bottom: 0.25rem;
}
.logo--footer {
  width: 160px;
  height: auto;
  max-height: 72px;
  object-fit: contain;
  margin-top: 1.5rem;
}

/* === Typography === */
.title-main {
  font-size: 1.6rem; font-weight: 800; color: #ffffff;
  letter-spacing: -0.5px; text-align: center;
  margin-bottom: 0.35rem;
}
.title-step {
  font-size: 1.4rem; font-weight: 800; color: #ffffff;
  letter-spacing: -0.5px; text-align: center;
  margin-bottom: 1.25rem;
}
.title-congrats {
  font-size: 2rem; font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(135deg, #ffffff 0%, #ff6b00 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}
.subtitle {
  font-size: 0.875rem; color: #a1a1aa;
  text-align: center; line-height: 1.5; font-weight: 400;
}
.subtitle--tombola {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ff6b00;
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}
.subtitle--congrats {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ff6b00;
  line-height: 1.45;
  margin-bottom: 1.5rem;
}
.subtitle--congrats strong { font-weight: 800; color: #ff6b00; }

/* === Camera === */
.camera-area { width: 100%; display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.75rem; }
.preview-container {
  width: 100%;
  max-height: 36vh;
  aspect-ratio: 3/4;
  border-radius: 16px;
  overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  border: 1.5px solid #28282b; background: #1c1c1e;
}
.photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-touch-callout: none;
  user-select: none;
}

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: none; border-radius: 14px; cursor: pointer; font-family: inherit;
  font-weight: 700; font-size: 1rem; padding: 0.95rem 1.5rem; width: 100%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-user-select: none; user-select: none; text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn--primary { background: #ff6b00; color: #fff; box-shadow: 0 4px 14px rgba(255,107,0,0.25); }
.btn--primary:hover { background: #e05a00; }
.btn--accent { background: #ffffff; color: #0c0c0e; box-shadow: 0 4px 14px rgba(255,255,255,0.15); }
.btn--accent:hover { background: #e4e7ec; }
.btn--large { padding: 1rem 1.5rem; font-size: 1rem; border-radius: 14px; }
.btn-icon { font-size: 1.1rem; }

/* === Form === */
.form { width: 100%; display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; text-align: left; }
.form-label { font-size: 0.8rem; font-weight: 700; color: #ffffff; letter-spacing: 0.2px; }
.form-input {
  padding: 0.85rem 1rem; border: 1.5px solid #28282b; border-radius: 12px;
  font-family: inherit; font-size: 0.95rem; color: #ffffff; font-weight: 500;
  background: #1c1c1e; transition: all 0.2s ease;
}
.form-input::placeholder { color: #71717a; }
.form-input:focus { outline: none; border-color: #ff6b00; background: #202023; box-shadow: 0 0 0 3px rgba(255,107,0,0.15); }
.form-input.invalid { border-color: #ef4444; background: #2d1a1a; }
.form-error { font-size: 0.75rem; color: #ef4444; font-weight: 600; }
.form-error--center { text-align: center; margin-top: 0.25rem; }

/* === Social === */
.social-label {
  font-size: 0.8rem; font-weight: 700; color: #ffffff;
  text-align: center; margin-bottom: 0.75rem;
}
.badge-required { font-size: 0.75rem; color: #a1a1aa; font-weight: 500; }
.social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; width: 100%; margin-bottom: 0.5rem; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.75rem 2rem 0.75rem 0.75rem; /* right padding to leave room for checkmark */
  border-radius: 12px; font-size: 0.85rem; font-weight: 700;
  text-decoration: none; color: #fff; transition: all 0.2s ease;
  position: relative;
}
.social-btn:hover { transform: translateY(-1px); }
.social-btn::after {
  content: '✓';
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%) scale(0);
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1;
  background: #22c55e;
  color: #ffffff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.social-btn.visited::after {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}
.social-btn--ig { background: linear-gradient(135deg, #f9ce34, #ee2a7b 50%, #6228d7); }
.social-btn--fb { background: #1877f2; }
.social-btn--tk { background: #222222; border: 1px solid #333333; }
.social-btn--gl { background: #ea4335; }
.social-icon { font-size: 1rem; }

/* === Processing === */
.spinner {
  width: 52px; height: 52px; border: 4px solid #242427; border-top-color: #ff6b00;
  border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 0.75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar {
  width: 100%; max-width: 260px; height: 6px;
  background: #242427; border-radius: 3px; overflow: hidden; margin-top: 0.75rem;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ff6b00, #ea580c);
  border-radius: 3px; transition: width 0.3s ease;
}

/* === Celebration === */
.confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }
.celebration-icon { font-size: 3.5rem; margin-bottom: 0.75rem; animation: bounce 0.6s ease infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-12px); } }
.error-icon { font-size: 3.5rem; margin-bottom: 0.75rem; }

/* === Animations === */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Desktop === */
@media (min-width: 480px) {
  body { background-color: #040405; }
  #appContainer { padding: 2rem 1rem; }
}
