/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  /* Brand Colors (Extracted and matched with reference image) */
  --primary-neon-green: #7bf11c;
  --primary-green-mid: #5cd607;
  --primary-green-deep: #1b4503;
  
  --primary-gold: #f5d300;
  --primary-gold-dark: #dfc400;
  
  /* Neutrals & UI States */
  --bg-dark: #050802;
  --bg-gradient-center: #0e1b06;
  --card-bg: rgba(10, 16, 6, 0.75);
  
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.45);
  
  --color-success: #7bf11c;
  --color-error: #ff4d4d;
  
  /* Typography */
  --font-sans: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  
  /* Layout */
  --border-radius-xl: 32px;
  --border-radius-lg: 24px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-neon: 0 0 30px rgba(123, 241, 28, 0.15), 0 20px 50px rgba(0, 0, 0, 0.7);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   ANIMATED BACKGROUND
   ========================================================================== */
.decorative-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, var(--bg-gradient-center) 0%, var(--bg-dark) 100%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.16;
  mix-blend-mode: screen;
}

.orb-1 {
  top: -10%;
  left: 15%;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, var(--primary-green-mid) 0%, transparent 70%);
  animation: floatOrb 25s infinite alternate ease-in-out;
}

.orb-2 {
  bottom: -10%;
  right: 15%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, var(--primary-gold-dark) 0%, transparent 70%);
  animation: floatOrb 30s infinite alternate-reverse ease-in-out;
  animation-delay: -5s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 8%) scale(1.08); }
  100% { transform: translate(-5%, -5%) scale(0.92); }
}

/* ==========================================================================
   LAYOUT CONTAINER & CARD
   ========================================================================== */
.container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 3rem 1.5rem;
  z-index: 1;
}

.rsvp-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(123, 241, 28, 0.28);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-neon);
  width: 100%;
  max-width: 600px;
  overflow: hidden;
  transition: var(--transition-smooth);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Subtly glow top-left/right of card */
.rsvp-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  border-radius: inherit;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

/* ==========================================================================
   CABECERA (TWO COLUMN GRID)
   ========================================================================== */
.card-header {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.75rem;
  align-items: center;
  padding: 2.25rem 2.25rem 1rem;
}

/* Mascot side */
.header-logo-side {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mascot-glow-ring {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 241, 28, 0.3) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  border: none;
  border-radius: 0;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
}

/* Text Invitation side */
.header-text-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

/* Estamos listos badge */
.top-badge {
  background: rgba(27, 69, 3, 0.35);
  border: 1px solid rgba(123, 241, 28, 0.28);
  border-radius: 50px;
  padding: 0.35rem 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0.75rem;
}

.badge-calendar-icon {
  width: 14px;
  height: 14px;
  color: var(--primary-neon-green);
}

.badge-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-neon-green);
  letter-spacing: 0.02em;
}

.card-title {
  font-family: var(--font-sans); /* Same as reference: modern geometric sans */
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gradient-text {
  background: linear-gradient(90deg, var(--primary-neon-green) 0%, var(--primary-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

.title-divider {
  border: none;
  height: 2px;
  width: 80px;
  background: linear-gradient(90deg, var(--primary-neon-green) 0%, transparent 100%);
  margin: 0.75rem 0;
}

.card-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.4;
}

/* ==========================================================================
   CARD BODY & FORM ROWS
   ========================================================================== */
.card-body {
  padding: 0.5rem 2.25rem 2.25rem;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Glowing left side circular icons */
.input-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(123, 241, 28, 0.35);
  background: rgba(5, 8, 2, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 15px rgba(123, 241, 28, 0.12), inset 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: var(--transition-smooth);
}

.badge-icon {
  width: 22px;
  height: 22px;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

/* When the corresponding input is focused, glow the badge */
.form-row:focus-within .input-badge {
  border-color: var(--primary-neon-green);
  box-shadow: 0 0 20px rgba(123, 241, 28, 0.35);
}

.form-row:focus-within .badge-icon {
  color: var(--primary-neon-green);
}

/* Input group */
.input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.input-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-neon-green);
  margin-bottom: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 3rem 0.75rem 1.15rem;
  background-color: rgba(5, 8, 2, 0.5);
  border: 1.2px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  transition: var(--transition-smooth);
  box-sizing: border-box;
}

input::placeholder {
  color: var(--text-muted);
}

input:hover {
  border-color: rgba(123, 241, 28, 0.3);
}

input:focus {
  background-color: rgba(5, 8, 2, 0.75);
  border-color: var(--primary-neon-green);
  box-shadow: 0 0 10px rgba(123, 241, 28, 0.12);
}

/* Checkmark valid state on input right side */
.valid-indicator {
  position: absolute;
  right: 1.15rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--primary-neon-green);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: var(--transition-smooth);
  pointer-events: none;
  background: rgba(123, 241, 28, 0.1);
}

.valid-indicator svg {
  width: 11px;
  height: 11px;
  color: var(--primary-neon-green);
}

/* Trigger valid state from native CSS validations */
input:user-valid {
  border-color: var(--primary-neon-green);
}

input:user-valid ~ .valid-indicator {
  opacity: 1;
  transform: scale(1);
}

input:user-invalid, input.is-invalid {
  border-color: var(--color-error);
}

/* Validation error messages */
.error-message {
  font-size: 0.8rem;
  color: var(--color-error);
  margin-top: 0.4rem;
  display: none;
  animation: slideDown 0.2s ease-out;
}

input:user-invalid ~ .error-message, input.is-invalid ~ .error-message {
  display: block;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   PERKS BLOCK (2 COLUMN BAR)
   ========================================================================== */
.perks-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.15rem 0.85rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 1.75rem 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.perk-divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
}

.perk-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.5rem;
}

.perk-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.perk-icon {
  width: 22px;
  height: 22px;
}

.perk-icon.color-green {
  color: var(--primary-neon-green);
}

.perk-icon.color-gold {
  color: var(--primary-gold);
}

.perk-text {
  display: flex;
  flex-direction: column;
}

.perk-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.perk-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* ==========================================================================
   PREMIUM PILL SUBMIT BUTTON
   ========================================================================== */
.submit-button {
  background: linear-gradient(90deg, var(--primary-green-mid) 0%, var(--primary-gold) 100%);
  border: none;
  min-height: 60px;
  border-radius: 50px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.85rem;
  transition: var(--transition-smooth);
  box-shadow: 0 10px 30px rgba(92, 214, 7, 0.35);
  position: relative;
  overflow: hidden;
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(245, 211, 0, 0.45);
}

.submit-button:active {
  transform: translateY(0);
}

/* Dark shield badge on left of button */
.btn-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: rgba(5, 8, 2, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-badge-icon {
  width: 20px;
  height: 20px;
  color: var(--primary-neon-green);
}

.btn-text {
  font-family: var(--font-sans);
  color: #050802;
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -0.01em;
  flex-grow: 1;
  text-align: center;
}

/* Arrow symbol on the right */
.btn-arrow {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-arrow svg {
  width: 18px;
  height: 18px;
  color: #050802;
}

/* Spinner */
.btn-spinner {
  display: none;
  width: 22px;
  height: 22px;
  border: 3.5px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  border-top-color: #000000;
  animation: spin 0.85s linear infinite;
  position: absolute;
  right: 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.submit-button.is-loading {
  pointer-events: none;
  opacity: 0.9;
}

.submit-button.is-loading .btn-arrow {
  display: none;
}

.submit-button.is-loading .btn-spinner {
  display: block;
}

/* ==========================================================================
   PRIVACY NOTE
   ========================================================================== */
.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.lock-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

/* ==========================================================================
   SUCCESS STATE STYLES
   ========================================================================== */
.success-state {
  text-align: center;
  align-items: center;
  padding: 2.5rem;
}

.success-icon-wrapper {
  margin-bottom: 1.5rem;
}

.success-checkmark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: var(--primary-neon-green);
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px rgba(123, 241, 28, 0.1);
  animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
  margin: 0 auto;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: var(--primary-neon-green);
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% { stroke-dashoffset: 0; }
}
@keyframes scale {
  0%, 100% { transform: none; }
  50% { transform: scale3d(1.1, 1.1, 1); }
}
@keyframes fill {
  100% { box-shadow: inset 0px 0px 0px 30px rgba(123, 241, 28, 0.08); }
}

.success-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--primary-gold);
  margin-bottom: 1rem;
}

.success-message {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.success-message strong {
  color: var(--primary-neon-green);
}

.success-note {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.reset-button {
  background: transparent;
  color: var(--primary-gold);
  border: 1.5px dashed var(--primary-gold-dark);
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.reset-button:hover {
  background: rgba(245, 211, 0, 0.08);
  border-color: var(--primary-gold);
  color: var(--text-primary);
}

/* ==========================================================================
   ADMIN PANEL STYLES
   ========================================================================== */
.admin-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 2, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

.admin-modal {
  background: #0d1408;
  border: 1.5px solid rgba(123, 241, 28, 0.35);
  width: 100%;
  max-width: 700px;
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-neon);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-header h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--primary-gold);
}

.close-admin {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 2.25rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-smooth);
}

.close-admin:hover {
  color: var(--color-error);
}

.admin-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}

.admin-actions {
  display: flex;
  gap: 1rem;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
  transition: var(--transition-smooth);
}

.export-btn {
  background: var(--primary-green-mid);
  color: #000;
}

.export-btn:hover {
  background: var(--primary-neon-green);
  box-shadow: 0 0 15px rgba(123, 241, 28, 0.3);
}

.clear-btn {
  background: rgba(255, 77, 77, 0.1);
  color: var(--color-error);
  border: 1px solid rgba(255, 77, 77, 0.25);
}

.clear-btn:hover {
  background: var(--color-error);
  color: var(--text-primary);
}

.admin-table-container {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-md);
  max-height: 350px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.admin-table th, .admin-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--primary-gold);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 2;
}

.admin-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.015);
}

.admin-table td {
  color: var(--text-secondary);
}

/* Custom Scrollbar for dashboard */
.admin-body::-webkit-scrollbar, .admin-table-container::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.admin-body::-webkit-scrollbar-track, .admin-table-container::-webkit-scrollbar-track {
  background: transparent;
}

.admin-body::-webkit-scrollbar-thumb, .admin-table-container::-webkit-scrollbar-thumb {
  background: rgba(123, 241, 28, 0.15);
  border-radius: 3px;
}

.admin-body::-webkit-scrollbar-thumb:hover, .admin-table-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary-neon-green);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  width: 100%;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  z-index: 1;
}

.secret-link {
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  transition: var(--transition-smooth);
}

.secret-link:hover {
  color: var(--primary-neon-green);
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 600px) {
  .container {
    padding: 1.5rem 0.75rem;
  }
  
  .rsvp-card {
    border-radius: 24px;
    border-width: 1.2px;
  }
  
  /* Collapse header to single column */
  .card-header {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 2rem 1.5rem 0.5rem;
    justify-items: center;
  }
  
  .header-logo-side {
    width: 200px;
    height: 200px;
  }
  
  .header-text-side {
    align-items: center;
    text-align: center;
  }
  
  .top-badge {
    margin-bottom: 0.5rem;
  }
  
  .card-title {
    font-size: 1.45rem;
  }
  
  .title-divider {
    margin: 0.5rem auto;
  }
  
  .card-body {
    padding: 0.5rem 1.5rem 1.5rem;
  }
  
  /* Form Rows */
  .form-row {
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }
  
  .input-badge {
    width: 44px;
    height: 44px;
  }
  
  .badge-icon {
    width: 18px;
    height: 18px;
  }
  
  input {
    min-height: 48px;
    padding: 0.65rem 2.5rem 0.65rem 0.85rem;
  }
  
  .valid-indicator {
    right: 0.85rem;
  }
  
  /* Perks - stack vertically on very small screens */
  .perks-container {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 1.25rem 1rem;
    margin: 1.25rem 0;
  }
  
  .perk-divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
  }
  
  .perk-item {
    padding: 0;
    justify-content: flex-start;
  }
  
  /* Pill Button */
  .submit-button {
    min-height: 52px;
    padding: 0 0.65rem;
  }
  
  .btn-badge {
    width: 38px;
    height: 38px;
  }
  
  .btn-text {
    font-size: 1.05rem;
  }
  
  .btn-arrow svg {
    width: 16px;
    height: 16px;
  }
  
  .admin-modal {
    max-height: 90vh;
  }
  
  .admin-body {
    padding: 1.25rem;
    gap: 1.25rem;
  }
  
  .admin-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .admin-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Touch coarse size helper */
@media (pointer: coarse) {
  input {
    min-height: 52px;
  }
  
  .submit-button {
    min-height: 56px;
  }
}
