/* ============================================================
   style.css — Nemolux Events Platform
   Single stylesheet for all frontend pages:
     - Registration form (index.html)
     - Self-service portal (portal.html)
     - Unsubscribe confirmation (served inline by server.js)
     - Check-in terminal (checkin.html)
   ============================================================ */


/* ============================================================
   ████████████████████████████████████████████████████████
   SECTION 1 — BRANDING
   Edit this section to re-brand for a new client.
   Everything else in this file references these variables.
   ████████████████████████████████████████████████████████
   ============================================================ */
:root {

  /* ----------------------------------------------------------
     BRAND COLORS
     ---------------------------------------------------------- */
  --brand-primary:       #0058AB;   /* Main brand color — buttons, headings, accents */
  --brand-primary-dark:  #004080;   /* Hover state for primary */
  --brand-primary-light: #E8F0FA;   /* Tinted backgrounds, subtle highlights */
  --brand-accent:        #FBD914;   /* Secondary accent — top card stripe, highlights */
  --brand-accent-dark:   #E0C000;   /* Hover/active state for accent */

  /* ----------------------------------------------------------
     EVENT IDENTITY
     These are display strings injected via /config API.
     They are listed here as documentation only — they do not
     drive CSS. Change them in config.json on the server.
     ---------------------------------------------------------- */
  /* event name:  Convención IKEA México                          */
  /* event date:  Jueves 28 de mayo de 2026 — 10:00 AM a 6:00 PM */
  /* event venue: World Trade Center Ciudad de México             */

  /* ----------------------------------------------------------
     TYPOGRAPHY
     Replace the font stack to change the typeface sitewide.
     If using a Google Font, add the <link> to each HTML file.
     ---------------------------------------------------------- */
  --font-body: 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* ----------------------------------------------------------
     CHECK-IN TERMINAL STATE COLORS
     Adjust these if the client's brand conflicts with the
     default green/amber/red semantics.
     ---------------------------------------------------------- */
  --checkin-valid-bg:     #1A5C38;   /* Full-screen bg — valid first-time scan */
  --checkin-valid-text:   #FFFFFF;
  --checkin-valid-sub:    rgba(255,255,255,0.75);

  --checkin-duplicate-bg:  #92400E;  /* Full-screen bg — already checked in */
  --checkin-duplicate-text:#FFFFFF;
  --checkin-duplicate-sub: rgba(255,255,255,0.75);

  --checkin-notfound-bg:  #991B1B;   /* Full-screen bg — code not found */
  --checkin-notfound-text:#FFFFFF;
  --checkin-notfound-sub: rgba(255,255,255,0.75);

  --checkin-ready-bg:     #1A1A2E;   /* Full-screen bg — idle/ready state */
  --checkin-ready-text:   #FFFFFF;
  --checkin-ready-sub:    rgba(255,255,255,0.5);

}


/* ============================================================
   ████████████████████████████████████████████████████████
   SECTION 2 — DESIGN TOKENS (SYSTEM)
   Do not edit per-client. These reference Section 1.
   ████████████████████████████████████████████████████████
   ============================================================ */
:root {

  /* Neutral palette */
  --color-bg:         #F5F6F8;
  --color-surface:    #FFFFFF;
  --color-border:     #DDE1E8;
  --color-text:       #1A1A2E;
  --color-text-muted: #6B7280;
  --color-text-light: #9CA3AF;

  /* Semantic feedback colors */
  --color-error:         #B91C1C;
  --color-error-bg:      #FEF2F1;
  --color-error-border:  rgba(185,28,28,0.2);

  --color-success:        #1A7F3C;
  --color-success-bg:     #EDF7F1;
  --color-success-border: rgba(26,127,60,0.2);

  --color-warning:        #B45309;
  --color-warning-bg:     #FFFBEB;
  --color-warning-border: rgba(180,83,9,0.2);

  /* Spacing scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-card:  0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-focus: 0 0 0 3px rgba(0,88,171,0.25);

  /* Transitions */
  --transition:      150ms ease;
  --transition-slow: 300ms ease;

}


/* ============================================================
   ████████████████████████████████████████████████████████
   SECTION 3 — RESET & BASE
   ████████████████████████████████████████████████████████
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}


/* ============================================================
   ████████████████████████████████████████████████████████
   SECTION 4 — PAGE LAYOUT
   Used by: index.html, portal.html, unsubscribe
   ████████████████████████████████████████████████████████
   ============================================================ */

/* Full-height centered layout */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-10) var(--space-5);
}

/* Top logo bar */
.page-header {
  width: 100%;
  max-width: 520px;
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-8);
}

.page-logo {
  height: 40px;
  width: auto;
}

/* Card container */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-10) var(--space-8);
  width: 100%;
  max-width: 520px;
}

/* Card inner sections */
.card-header {
  margin-bottom: var(--space-8);
}

.card-footer {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

/* Yellow accent stripe at top of card */
.card-accent {
  height: 4px;
  background: var(--brand-accent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin: calc(-1 * var(--space-10)) calc(-1 * var(--space-8)) var(--space-8);
}


/* ============================================================
   ████████████████████████████████████████████████████████
   SECTION 5 — TYPOGRAPHY
   ████████████████████████████████████████████████████████
   ============================================================ */

.page-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-primary);
  margin-bottom: var(--space-2);
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: var(--space-2);
}

.page-subtitle {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}


/* ============================================================
   ████████████████████████████████████████████████████████
   SECTION 6 — FORM ELEMENTS
   ████████████████████████████████████████████████████████
   ============================================================ */

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.field-input {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.field-input::placeholder {
  color: var(--color-text-light);
}

.field-input:focus {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-focus);
}

.field-input.is-error {
  border-color: var(--color-error);
}

.field-input.is-error:focus {
  box-shadow: 0 0 0 3px rgba(185,28,28,0.2);
}

/* Large input variant — check-in terminal manual entry */
.field-input-lg {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: #FFFFFF;
  outline: none;
  width: 100%;
  transition: border-color var(--transition), background var(--transition);
  -webkit-appearance: none;
}

.field-input-lg::placeholder {
  color: rgba(255,255,255,0.4);
  font-weight: 400;
  letter-spacing: 0;
}

.field-input-lg:focus {
  border-color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.15);
}


/* ============================================================
   ████████████████████████████████████████████████████████
   SECTION 7 — BUTTONS
   ████████████████████████████████████████████████████████
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-6);
  border: none;
  cursor: pointer;
  transition: background-color var(--transition), opacity var(--transition), transform var(--transition);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

/* Primary — blue fill */
.btn-primary {
  background: var(--brand-primary);
  color: #FFFFFF;
  width: 100%;
  padding: var(--space-4) var(--space-6);
  font-size: 16px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-primary-dark);
  text-decoration: none;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Secondary — ghost outline */
.btn-secondary {
  background: transparent;
  color: var(--brand-primary);
  border: 1.5px solid var(--brand-primary);
  width: 100%;
  padding: var(--space-3) var(--space-6);
}

.btn-secondary:hover {
  background: var(--brand-primary-light);
  text-decoration: none;
}

/* Ghost on dark — check-in terminal */
.btn-ghost-dark {
  background: rgba(255,255,255,0.12);
  color: #FFFFFF;
  border: 1.5px solid rgba(255,255,255,0.3);
  padding: var(--space-3) var(--space-6);
}

.btn-ghost-dark:hover {
  background: rgba(255,255,255,0.2);
  text-decoration: none;
}

/* Small variant */
.btn-sm {
  font-size: 13px;
  padding: var(--space-2) var(--space-4);
}


/* ============================================================
   ████████████████████████████████████████████████████████
   SECTION 8 — INLINE MESSAGES & BANNERS
   ████████████████████████████████████████████████████████
   ============================================================ */

.message {
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.message-icon {
  flex-shrink: 0;
  font-size: 16px;
  margin-top: 1px;
}

.message-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid var(--color-error-border);
}

.message-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.message-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.message-info {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  border: 1px solid rgba(0,88,171,0.2);
}


/* ============================================================
   ████████████████████████████████████████████████████████
   SECTION 9 — EVENT INFO BLOCK
   Used by: index.html, portal.html, closed gate
   ████████████████████████████████████████████████████████
   ============================================================ */

.event-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.event-info-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  line-height: 1.5;
}

.event-info-icon {
  flex-shrink: 0;
  font-size: 15px;
  margin-top: 1px;
}

.event-info-text {
  color: var(--color-text);
  font-size: 14px;
}


/* ============================================================
   ████████████████████████████████████████████████████████
   SECTION 10 — SUCCESS & REGISTRATION STATE
   Used by: registration success screen, portal page
   ████████████████████████████████████████████████████████
   ============================================================ */

.success-icon {
  width: 56px;
  height: 56px;
  background: var(--color-success-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  font-size: 26px;
}

/* Short code display — large, branded */
.success-code {
  display: inline-block;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--brand-primary);
  background: var(--brand-primary-light);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-6);
  margin: var(--space-4) 0;
}

/* QR code display block — portal page */
.qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.qr-block canvas,
.qr-block img {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-sm);
}

/* Countdown display — portal page */
.countdown-block {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  background: var(--brand-primary-light);
  border-radius: var(--radius-md);
}

.countdown-number {
  font-size: 52px;
  font-weight: 700;
  color: var(--brand-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.countdown-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-primary);
  opacity: 0.75;
}

.countdown-today {
  font-size: 20px;
  font-weight: 700;
  color: var(--brand-primary);
}

/* Resend button — sent confirmation state */
.resend-btn-sent {
  background: var(--color-success-bg) !important;
  color: var(--color-success) !important;
  border-color: var(--color-success-border) !important;
  cursor: default !important;
}


/* ============================================================
   ████████████████████████████████████████████████████████
   SECTION 11 — CLOSED GATE STATE
   Used by: index.html when registration_open = false
   ████████████████████████████████████████████████████████
   ============================================================ */

.gate-icon {
  width: 56px;
  height: 56px;
  background: var(--brand-primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  font-size: 26px;
}


/* ============================================================
   ████████████████████████████████████████████████████████
   SECTION 12 — CHECK-IN TERMINAL
   Used by: checkin.html (operator-facing, Stage 5)
   Full-screen layout — overrides normal body/page defaults.
   ████████████████████████████████████████████████████████
   ============================================================ */

/* Applied to <body> on the terminal page only */
body.terminal-page {
  background: var(--checkin-ready-bg);
  overflow: hidden;          /* No scrolling on terminal */
  user-select: none;         /* Prevent accidental text selection */
  -webkit-user-select: none;
}

/* Full-screen state panels — one visible at a time */
.terminal-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  text-align: center;
}

.terminal-screen.is-hidden {
  display: none;
}

/* State-specific backgrounds */
.terminal-screen--ready     { background: var(--checkin-ready-bg);     color: var(--checkin-ready-text); }
.terminal-screen--valid     { background: var(--checkin-valid-bg);     color: var(--checkin-valid-text); }
.terminal-screen--duplicate { background: var(--checkin-duplicate-bg); color: var(--checkin-duplicate-text); }
.terminal-screen--notfound  { background: var(--checkin-notfound-bg);  color: var(--checkin-notfound-text); }

/* Large attendee name on result screens — readable from 2m */
.terminal-name {
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--space-4);
  word-break: break-word;
  max-width: 800px;
}

/* Status label below the name */
.terminal-status {
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: var(--space-8);
}

/* Timestamp — shown on duplicate screen */
.terminal-timestamp {
  font-size: 15px;
  opacity: 0.65;
  margin-top: calc(-1 * var(--space-4));
  margin-bottom: var(--space-8);
}

/* Status icon */
.terminal-icon {
  font-size: clamp(48px, 8vw, 96px);
  margin-bottom: var(--space-6);
  line-height: 1;
}

/* Prompt text on ready screen */
.terminal-prompt {
  font-size: clamp(16px, 2vw, 20px);
  opacity: 0.5;
  margin-top: var(--space-4);
  letter-spacing: 0.02em;
}

/* Input area — manual code/email entry on ready screen */
.terminal-input-area {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-10);
}

/* Tab switcher — code vs email fallback */
.terminal-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: var(--space-4);
}

.terminal-tab {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.45);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  margin-bottom: -1px;
}

.terminal-tab.is-active {
  color: #FFFFFF;
  border-bottom-color: #FFFFFF;
}

/* Auto-reset progress bar — animates during result display */
.terminal-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 5px;
  background: rgba(255,255,255,0.4);
  width: 100%;
  transform-origin: left;
}

@keyframes terminal-countdown {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}


/* ============================================================
   ████████████████████████████████████████████████████████
   SECTION 13 — LOADING SPINNER
   ████████████████████████████████████████████████████████
   ============================================================ */

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* Spinner variant for light backgrounds */
.spinner-dark {
  border-color: rgba(0,88,171,0.25);
  border-top-color: var(--brand-primary);
}

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


/* ============================================================
   ████████████████████████████████████████████████████████
   SECTION 14 — UTILITY CLASSES
   ████████████████████████████████████████████████████████
   ============================================================ */

.hidden         { display: none !important; }
.text-center    { text-align: center; }
.text-left      { text-align: left; }

.text-muted {
  color: var(--color-text-muted);
  font-size: 14px;
}

.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-6) 0;
}

.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }


/* ============================================================
   ████████████████████████████████████████████████████████
   SECTION 15 — RESPONSIVE
   Attendee pages only — terminal is always fullscreen.
   ████████████████████████████████████████████████████████
   ============================================================ */

@media (max-width: 560px) {
  .page {
    padding: var(--space-6) var(--space-4);
  }

  .card {
    padding: var(--space-8) var(--space-6);
  }

  .card-accent {
    margin: calc(-1 * var(--space-8)) calc(-1 * var(--space-6)) var(--space-6);
  }

  .page-title {
    font-size: 20px;
  }

  .success-code {
    font-size: 22px;
  }

  .qr-block canvas,
  .qr-block img {
    width: 160px;
    height: 160px;
  }

  .countdown-number {
    font-size: 40px;
  }
}
