/* ==========================================================================
   RIS Portal Design System
   Research and Information System for Developing Countries (RIS), New Delhi
   Aesthetic: Clean, Institutional, Academic, Accessible, Mobile-First
   ========================================================================== */

:root {
  /* Institutional Color Palette — derived from the RIS seal (oxblood maroon)
     and wordmark (deep olive), not an invented "tech" palette.
     Navy carries headings/structure ("read me"); maroon is reserved for
     interactive/action moments ("click me"); bronze marks file downloads. */
  --color-brand-primary: #0b2545;        /* Deep Academic Navy — headings / structure */
  --color-brand-secondary: #134074;      /* Mid Slate Blue — secondary text / links */
  --color-brand-accent: #7a2331;         /* Oxblood Maroon — from the RIS seal; buttons & controls */
  --color-brand-accent-hover: #5e1a25;
  --color-brand-bronze: #5b5a2a;         /* Deep Olive Bronze — from the RIS wordmark; file downloads */
  --color-brand-bronze-hover: #454420;

  /* Government / Institutional Flag Accent */
  --color-tricolor-saffron: #f97316;
  --color-tricolor-green: #15803d;

  /* Neutral Paper Palette (warm, editorial — not cold tech-slate) */
  --color-bg-page: #f8f6f2;            /* Warm paper canvas */
  --color-bg-surface: #ffffff;         /* Pure white container */
  --color-bg-surface-subtle: #f1ede4;  /* Warm parchment tint */
  --color-bg-hover: #f8f6f2;

  /* Typography Colors */
  --color-text-main: #221f1a;          /* Warm near-black */
  --color-text-body: #47433c;
  --color-text-muted: #6f6a60;
  --color-text-inverse: #ffffff;

  /* Form Borders & States */
  --color-border-default: #d9d2c5;
  --color-border-hover: #b6ad9d;
  --color-border-focus: #134074;
  --color-focus-ring: rgba(122, 35, 49, 0.25);

  /* Status Colors — muted institutional tones, not saturated SaaS candy colors */
  --color-error-text: #7a2f24;
  --color-error-bg: #f5ebe8;
  --color-error-border: #b23a2a;
  --color-error-ring: rgba(178, 58, 42, 0.2);

  --color-success-text: #3c5a3c;
  --color-success-bg: #ecf1e7;
  --color-success-border: #6b8a61;

  /* Semantic tag/badge tones — used across admin badges instead of ad-hoc hex */
  --color-tag-neutral-bg: #ece7dd;
  --color-tag-neutral-text: #5c574c;
  --color-tag-info-bg: #e7eaf1;
  --color-tag-info-text: #223252;
  --color-tag-attention-bg: #f4ead2;
  --color-tag-attention-text: #7a5c1e;
  
  /* Typography Scales */
  --font-family-serif: 'Charter', 'Bitstream Charter', 'Merriweather', 'Georgia', serif;
  --font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  
  --font-size-xs: 0.8125rem;   /* 13px */
  --font-size-sm: 0.875rem;    /* 14px */
  --font-size-base: 1rem;      /* 16px */
  --font-size-md: 1.125rem;    /* 18px */
  --font-size-lg: 1.25rem;     /* 20px */
  --font-size-xl: 1.5rem;      /* 24px */
  --font-size-2xl: 1.875rem;   /* 30px */

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Elevation & Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 4px 16px 0 rgba(15, 23, 42, 0.03);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family-sans);
  background-color: var(--color-bg-page);
  color: var(--color-text-body);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Screen reader utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================================================
   Institutional Header & Branding
   ========================================================================== */
.site-header {
  background-color: var(--color-bg-surface);
  border-bottom: 1px solid var(--color-border-default);
  box-shadow: var(--shadow-sm);
  position: relative;
}

/* Tricolor Sovereign Academic Line */
.site-header::before {
  content: "";
  display: block;
  height: 3px;
  width: 100%;
  background: linear-gradient(
    90deg, 
    var(--color-tricolor-saffron) 0%, 
    var(--color-tricolor-saffron) 33.3%, 
    #ffffff 33.3%, 
    #ffffff 66.6%, 
    var(--color-tricolor-green) 66.6%, 
    var(--color-tricolor-green) 100%
  );
}

.header-container {
  max-width: 820px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: var(--space-2);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.ris-official-logo {
  height: 52px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.brand-divider {
  width: 1px;
  height: 40px;
  background: var(--color-border-default);
  flex-shrink: 0;
  margin: 0 var(--space-1);
}

.dakshin-official-logo {
  height: 52px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  background: #ffffff;
}

.partner-logo {
  height: 44px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  background: #ffffff;
}

/* ==========================================================================
   Event Banner (Hero) — height:auto lets the wrapper size itself to the
   uploaded image's own aspect ratio at full width, so a normal landscape
   banner (the admin upload hint recommends ~3:1) shows edge to edge with
   no cropping and no empty side-bars. max-height is only a generous safety
   net for a badly-proportioned upload (e.g. an accidental portrait photo);
   object-fit:contain on the sharp foreground image guarantees it's never
   cropped even then, and a blurred, scaled-up copy of the same image fills
   any resulting gap behind it, so that rare case still reads as an
   intentional blurred backdrop instead of empty letterbox bars.
   ========================================================================== */
.event-banner-wrapper {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.event-banner-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(24px) brightness(0.55) saturate(1.1);
  transform: scale(1.15);
  display: block;
}
.event-banner-fg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .header-container {
    padding: var(--space-2) var(--space-3);
  }
  .ris-official-logo {
    height: 40px;
  }
  .brand-divider {
    height: 32px;
  }
  .dakshin-official-logo {
    height: 40px;
  }
  .partner-logo {
    height: 34px;
  }
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-wrapper {
  flex: 1 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-12);
  display: flex;
  justify-content: center;
}

.portal-container {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

/* ==========================================================================
   Page Introduction Card
   ========================================================================== */
.intro-section {
  margin-bottom: var(--space-6);
  text-align: left;
}

.page-title {
  font-family: var(--font-family-serif);
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-brand-primary);
  line-height: 1.25;
  margin-bottom: var(--space-2);
}

.intro-lead {
  font-size: var(--font-size-base);
  color: var(--color-text-body);
  line-height: 1.6;
}

/* ==========================================================================
   Form Card & Hierarchy
   ========================================================================== */
.form-card {
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-8);
  position: relative;
}

@media (max-width: 600px) {
  .form-card {
    padding: var(--space-5) var(--space-4);
    border-radius: var(--radius-md);
  }
  .page-title {
    font-size: 1.625rem;
  }
}

.form-section {
  padding-bottom: var(--space-8);
  margin-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border-default);
}

.form-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.section-header {
  margin-bottom: var(--space-5);
}

.section-title {
  font-family: var(--font-family-serif);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-brand-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  line-height: 1.3;
}

.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background-color: var(--color-bg-surface-subtle);
  color: var(--color-brand-secondary);
  font-family: var(--font-family-sans);
  font-size: var(--font-size-xs);
  font-weight: 700;
  border: 1px solid var(--color-border-default);
}

.section-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ==========================================================================
   Grid & Form Field Controls
   ========================================================================== */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5) var(--space-4);
}

.col-span-2 {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .field-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .col-span-2 {
    grid-column: span 1;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  position: relative;
}

.form-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: 4px;
}

.required-star {
  color: var(--color-error-text);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}

.optional-tag {
  font-weight: 400;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-left: 2px;
}

/* Text Inputs, Selects */
.input-control {
  width: 100%;
  height: 44px; /* Accessible touch target */
  padding: 0 var(--space-3);
  font-family: inherit;
  font-size: var(--font-size-base);
  color: var(--color-text-main);
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  appearance: none;
}

select.input-control {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.15rem;
  cursor: pointer;
}

.input-control::placeholder {
  color: #94a3b8;
  font-size: 0.9375rem;
}

.input-control:hover:not(:disabled):not(:focus) {
  border-color: var(--color-border-hover);
}

.input-control:focus,
.input-control:focus-visible {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.input-control:disabled {
  background-color: var(--color-bg-surface-subtle);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.8;
}

/* Locked invitee fields (readonly, not disabled — see app.js) — greyed out
   like a disabled field, but focusable so screen readers still announce it
   as a real field with a value, not skip it entirely. */
.input-control:read-only {
  background-color: var(--color-bg-surface-subtle);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.input-control:read-only:focus {
  box-shadow: none;
  border-color: var(--color-border-default);
}

.field-helper {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 5px;
  line-height: 1.35;
}

/* Error State on Input */
.has-error .input-control {
  border-color: var(--color-error-border);
  background-color: var(--color-error-bg);
}

.has-error .input-control:focus {
  border-color: var(--color-error-border);
  box-shadow: 0 0 0 3px var(--color-error-ring);
}

.field-error-msg {
  display: none;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--color-error-text);
  margin-top: 5px;
  line-height: 1.3;
}

.has-error .field-error-msg {
  display: flex;
}

/* ==========================================================================
   Checkbox Groups (Areas of Interest & Preferences)
   ========================================================================== */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

@media (max-width: 600px) {
  .checkbox-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
}

.checkbox-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.checkbox-card:hover {
  background-color: var(--color-bg-hover);
  border-color: var(--color-border-hover);
}

.checkbox-card:has(input:checked) {
  border-color: var(--color-brand-secondary);
  background-color: #faf3f0;
}

.checkbox-card:has(input:focus-visible) {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
  border-color: var(--color-brand-secondary);
}

/* Custom Checkbox Affordance */
.custom-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0 0;
  flex-shrink: 0;
  border: 1.5px solid var(--color-border-default);
  border-radius: 4px;
  background-color: #ffffff;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: all 0.15s ease;
}

.custom-checkbox:hover {
  border-color: var(--color-brand-secondary);
}

.custom-checkbox:checked {
  background-color: var(--color-brand-accent);
  border-color: var(--color-brand-accent);
}

.custom-checkbox::after {
  content: "";
  width: 6px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  margin-top: -2px;
  transition: transform 0.15s ease-in-out;
}

.custom-checkbox:checked::after {
  transform: rotate(45deg) scale(1);
}

.checkbox-label-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-main);
  line-height: 1.4;
  font-weight: 500;
  flex: 1;
}

.checkbox-sublabel {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* Stacked List variant for Section 3 (Preferences) */
.checkbox-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.checkbox-card.stacked {
  padding: var(--space-3) var(--space-4);
}

/* Conditional Other field transition */
.conditional-container {
  display: none;
  margin-top: var(--space-3);
  padding: var(--space-4);
  background-color: var(--color-bg-surface-subtle);
  border: 1px dashed var(--color-border-default);
  border-radius: var(--radius-md);
  animation: fadeIn 0.2s ease-out;
}

.conditional-container.is-visible {
  display: block;
}

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

/* ==========================================================================
   Section 4: Consent & Legal
   ========================================================================== */
.consent-wrapper {
  background-color: var(--color-bg-surface-subtle);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.consent-wrapper:hover {
  border-color: var(--color-border-hover);
}

.consent-wrapper.has-error {
  border-color: var(--color-error-border);
  background-color: var(--color-error-bg);
}

.consent-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-body);
  line-height: 1.5;
}

.privacy-link {
  display: inline-block;
  margin-top: var(--space-1);
  color: var(--color-brand-secondary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: var(--font-size-sm);
  font-family: inherit;
}

.privacy-link:hover {
  color: var(--color-brand-accent);
}

.privacy-link:focus-visible {
  outline: 2px solid var(--color-brand-secondary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ==========================================================================
   Submission Area & Buttons
   ========================================================================== */
.submit-area {
  margin-top: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 48px;
  padding: 0 var(--space-8);
  background-color: var(--color-brand-accent);
  color: var(--color-text-inverse);
  font-family: inherit;
  font-size: var(--font-size-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(122, 35, 49, 0.2);
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  width: 100%;
}

@media (min-width: 601px) {
  .btn-primary {
    width: auto;
    min-width: 200px;
    align-self: flex-start;
  }
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-brand-accent-hover);
  box-shadow: 0 4px 8px rgba(122, 35, 49, 0.25);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring), 0 2px 4px rgba(122, 35, 49, 0.2);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-primary.is-loading .btn-spinner {
  display: inline-block;
}

.btn-primary.is-loading .btn-text {
  opacity: 0.9;
}

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

/* Form Level Error Alert Banner */
.form-alert-error {
  display: none;
  padding: var(--space-4);
  background-color: var(--color-error-bg);
  border: 1px solid var(--color-error-border);
  border-radius: var(--radius-md);
  color: var(--color-error-text);
  font-size: var(--font-size-sm);
  line-height: 1.45;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  animation: fadeIn 0.2s ease-out;
}

.form-alert-error.is-visible {
  display: flex;
}

/* Informational variant — for states that aren't failures (e.g. "you're
   already registered"), so the calm blue tone doesn't read as an error. */
.form-alert-error.is-info {
  background-color: var(--color-tag-info-bg);
  border-color: #c7cee0;
  color: var(--color-tag-info-text);
}

.alert-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ==========================================================================
   Success State Card
   ========================================================================== */
.success-container {
  display: none;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-10) var(--space-8);
  text-align: center;
  animation: fadeIn 0.25s ease-out;
}

.success-container.is-visible {
  display: block;
}

.success-icon-badge {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background-color: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: var(--color-success-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.success-icon-badge svg {
  width: 32px;
  height: 32px;
}

.success-title {
  font-family: var(--font-family-serif);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-brand-primary);
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

.success-primary-msg {
  font-size: var(--font-size-md);
  color: var(--color-text-main);
  max-width: 540px;
  margin: 0 auto var(--space-3);
  font-weight: 500;
}

.success-secondary-msg {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  max-width: 480px;
  margin: 0 auto var(--space-8);
  line-height: 1.5;
}

.success-follow-box {
  max-width: 420px;
  margin: 0 auto var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px dashed var(--color-border-default);
}

.success-follow-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.success-follow-links {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-6);
  height: 44px;
  background-color: #ffffff;
  color: var(--color-brand-secondary);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background-color: var(--color-bg-surface-subtle);
  border-color: var(--color-border-hover);
}

.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

/* Download / Export tier — a distinct, consistent signifier for any action
   that hands the user a file (PDF, QR image, CSV, ICS). Kept visually apart
   from navigational secondary actions so the pattern is learnable at a glance. */
.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 var(--space-6);
  height: 44px;
  background-color: #ffffff;
  color: var(--color-brand-bronze);
  border: 1px solid var(--color-brand-bronze);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-download:hover {
  background-color: var(--color-brand-bronze);
  color: #ffffff;
}

.btn-download:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(91, 90, 42, 0.25);
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  background-color: var(--color-bg-surface);
  border-top: 1px solid var(--color-border-default);
  padding: var(--space-6) var(--space-4);
  text-align: center;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

.footer-link {
  color: var(--color-brand-secondary);
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Privacy Policy Modal
   ========================================================================== */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal-backdrop.is-active {
  display: flex;
}

.modal-box {
  background-color: var(--color-bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border-default);
}

.modal-title {
  font-family: var(--font-family-serif);
  font-size: var(--font-size-lg);
  color: var(--color-brand-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.modal-close-btn:hover {
  background-color: var(--color-bg-surface-subtle);
  color: var(--color-text-main);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  font-size: var(--font-size-sm);
  color: var(--color-text-body);
  line-height: 1.6;
}

.modal-body h4 {
  color: var(--color-brand-primary);
  margin: var(--space-4) 0 var(--space-2);
}

.modal-body h4:first-child {
  margin-top: 0;
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border-default);
  display: flex;
  justify-content: flex-end;
}


/* ==========================================================================
   Digital Attendee Entry Card
   ========================================================================== */
.entry-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: center;
  padding: 0 var(--space-6) var(--space-6);
  box-shadow: var(--shadow-card);
}
.entry-card-topbar {
  height: 8px;
  background: var(--color-brand-accent);
  margin: 0 calc(-1 * var(--space-6)) var(--space-4);
}
.entry-card-logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: var(--space-3) auto var(--space-2);
}
.entry-card-logo-ris {
  height: 34px;
  width: auto;
  object-fit: contain;
  display: block;
}
.entry-card-logo-divider {
  width: 1px;
  height: 28px;
  background: var(--color-border-default);
  flex-shrink: 0;
}
.entry-card-logo-dakshin {
  height: 34px;
  width: auto;
  object-fit: contain;
  background: #ffffff;
  display: block;
}
.entry-card-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-brand-bronze);
  margin-bottom: var(--space-3);
}
.entry-card-name {
  font-family: var(--font-family-serif);
  font-size: 1.375rem;
  color: var(--color-brand-primary);
  margin-bottom: var(--space-3);
  word-break: break-word;
}
.entry-card-divider {
  height: 1px;
  background: var(--color-border-default);
  margin-bottom: var(--space-3);
}
.entry-card-event-title {
  font-weight: 700;
  font-size: var(--font-size-md);
  color: var(--color-text-main);
}
.entry-card-event-sub {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
  margin-bottom: var(--space-4);
}
.entry-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--font-size-sm);
  color: var(--color-text-body);
  margin-bottom: var(--space-4);
  text-align: left;
  background: var(--color-bg-surface-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}
.entry-card-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.entry-card-meta-label {
  min-width: 44px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  padding-top: 1px;
}
.entry-card-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.entry-card-qr {
  width: 140px;
  height: 140px;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  padding: 6px;
  background: #ffffff;
}
.entry-card-qr-caption {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.entry-card-serial {
  font-family: monospace;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
}
.entry-card-footer {
  margin-top: var(--space-4);
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  border-top: 1px dashed var(--color-border-default);
  padding-top: var(--space-3);
}

.entry-card-back {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
}
.entry-card-social-grid {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-2);
}
.entry-card-qr-sm {
  width: 100px;
  height: 100px;
}

@media print {
  /* Removing siblings via display:none (not visibility:hidden) collapses
     their layout height too — otherwise the printed document's height is
     still the full dashboard's height, and a position:fixed card repeats
     on every one of those extra pages instead of printing once. */
  body > *:not(#modal-attendee-card) {
    display: none !important;
  }
  #modal-attendee-card {
    position: static !important;
    width: auto !important;
    height: auto !important;
    inset: auto !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    padding: 0 !important;
  }
  #modal-attendee-card .modal-box {
    max-width: 100% !important;
    max-height: none !important;
    width: auto !important;
    box-shadow: none !important;
    animation: none !important;
  }
  #modal-attendee-card .modal-body {
    overflow: visible !important;
    padding: 0 !important;
  }
  .no-print {
    display: none !important;
  }
  .entry-card {
    box-shadow: none;
  }
  .entry-card-back {
    margin-top: 0;
    break-before: page;
  }
}


/* ==========================================================================
   Dynamic Event Metadata Banner & Post-Submission Actions
   ========================================================================== */
.event-meta-banner {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-bg-surface-subtle);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
}

.event-meta-items {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.event-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-main);
  font-weight: 500;
}

.event-meta-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-text-muted);
}

.visibility-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}
.visibility-badge.is-public { background: var(--color-success-bg); color: var(--color-success-text); }
.visibility-badge.is-private { background: var(--color-error-bg); color: var(--color-error-text); }

.event-agenda-link-btn {
  color: var(--color-brand-secondary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: var(--font-size-xs);
  display: inline-flex;
  align-items: center;
}

.event-agenda-link-btn:hover {
  color: var(--color-brand-accent);
}

/* ==========================================================================
   Minimal Editorial Theme — scoped to <body class="theme-minimal"> only
   (currently just register.html) so admin/agenda/unsubscribe/participants
   keep the standard boxed-card look. Same fields, same ids/names, same
   validation hooks (.has-error, .field-error-msg) — visual layer only.
   ========================================================================== */
/* Not scoped to .theme-minimal — used standalone on agenda.html's heading
   too, where the rest of the minimal theme (pill buttons etc.) doesn't fit
   a page with multiple inline action buttons and a table. */
.kicker {
  display: block;
  font-family: var(--font-family-serif);
  font-weight: 700;
  font-size: var(--font-size-base);
  color: var(--color-brand-primary);
  margin-bottom: var(--space-3);
}

/* More top-of-page air than the old boxed card needed — the card's own
   border/shadow used to visually separate content from the header; now
   that it's a flat flow on the page background, it needs the whitespace
   to read as intentional instead of cramped. */
.theme-minimal .main-wrapper {
  padding-top: var(--space-10);
}

.theme-minimal .portal-container {
  max-width: 760px;
}

.theme-minimal .intro-section {
  margin-bottom: var(--space-10);
}

.theme-minimal .page-title {
  font-size: 2.25rem;
  margin-bottom: var(--space-3);
}

.theme-minimal .intro-lead {
  margin-top: var(--space-3);
  max-width: 46ch;
}

/* Card becomes an unbounded flow on the page's own paper background */
.theme-minimal .form-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.theme-minimal .form-section {
  /* <fieldset> has a default browser border that the old design never
     needed to reset — the boxed white card sat on top of it and hid it.
     With the card now transparent, it shows through as a stray rectangle
     unless reset here. */
  border: none;
  padding-inline: 0;
  margin-inline: 0;
  padding-bottom: var(--space-8);
  margin-bottom: var(--space-8);
}

.theme-minimal .section-title {
  padding-inline: 0; /* reset default <legend> inset */
}

.theme-minimal .section-header {
  margin-bottom: var(--space-6);
}

/* More generous field-to-field air than the boxed layout used, now that
   pairs of fields (Name+Email, Institution+Designation, City+Country)
   sit close together horizontally — extra vertical rhythm and a wider
   column gutter keep rows from feeling stacked on top of each other. */
.theme-minimal .field-grid {
  row-gap: var(--space-8);
  column-gap: var(--space-6);
}

/* Numbered badge dropped; section title becomes a small eyebrow label
   instead of a heading, since the flow no longer reads as numbered steps */
.theme-minimal .section-number {
  display: none;
}

.theme-minimal .section-title {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Underline inputs instead of boxed fields */
.theme-minimal .input-control {
  height: auto;
  padding: var(--space-2) 2px;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--color-border-default);
  border-radius: 0;
}

.theme-minimal select.input-control {
  background-position: right 2px center;
}

.theme-minimal .input-control:hover:not(:disabled):not(:focus) {
  border-bottom-color: var(--color-border-hover);
}

.theme-minimal .input-control:focus,
.theme-minimal .input-control:focus-visible {
  box-shadow: none;
  border-bottom-width: 2px;
  border-bottom-color: var(--color-border-focus);
}

.theme-minimal .has-error .input-control {
  background: transparent;
  border-bottom-color: var(--color-error-border);
}

/* Base .input-control:read-only fills a background box, which doesn't fit
   the underline-only aesthetic here — keep it transparent, muted text and
   cursor still signal "locked" clearly enough against the underline. */
.theme-minimal .input-control:read-only {
  background: transparent;
}

/* Areas of Interest: bordered checkbox cards become pill toggles.
   The checkbox itself is visually hidden (kept in the accessibility tree,
   still keyboard-focusable) since the pill's fill communicates checked
   state, matching the reference design; the existing
   .checkbox-card:has(input:focus-visible) rule still draws a focus ring. */
.theme-minimal .checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.theme-minimal .checkbox-card {
  width: auto;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  gap: 0;
}

.theme-minimal .checkbox-card:has(input:checked) {
  background: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
}

.theme-minimal .checkbox-card:has(input:checked) .checkbox-label-text {
  color: var(--color-text-inverse);
}

.theme-minimal .checkbox-grid .custom-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.theme-minimal .checkbox-label-text {
  flex: none;
  font-weight: 500;
}

.theme-minimal .conditional-container {
  background: transparent;
  border: none;
  padding: 0;
}

/* Consent: drop the boxed panel, keep the real checkbox visible (unlike
   the interest pills above — this one needs to read as a literal consent
   checkbox, not a toggle chip) */
.theme-minimal .consent-wrapper {
  background: transparent;
  border: none;
  padding: 0;
  align-items: center;
}

/* Full-width pill submit button, on-brand accent (not the muted grey in
   the reference — that read as a disabled/inactive state, and this button
   is always clickable, so keeping it visually "live" avoids implying it's
   disabled) */
.theme-minimal .btn-primary {
  border-radius: var(--radius-full);
  height: 52px;
}

@media (min-width: 601px) {
  .theme-minimal .btn-primary {
    width: 100%;
    min-width: 0;
    align-self: stretch;
  }
}

.theme-minimal .btn-secondary {
  border-radius: var(--radius-full);
  width: 100%;
}

/* ==========================================================================
   Preference list (unsubscribe.html) — .pref-card-label / .pref-title /
   .pref-desc / .checkbox-control had no rules anywhere in this file before
   (rendered as bare unstyled checkboxes + text). Styled here to match the
   minimal-theme list language: no card box, checkbox + title + description
   stacked in a plain row, since these need the description line preserved
   unlike the Areas of Interest pills (which drop descriptions entirely).
   ========================================================================== */
.preference-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.pref-card-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}

.pref-card-content {
  display: flex;
  flex-direction: column;
}

.pref-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-main);
  line-height: 1.4;
}

.pref-desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* Same visual treatment as .custom-checkbox, kept as its own rule since
   .checkbox-control is this page's own class name for the same control. */
.checkbox-control {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  border: 1.5px solid var(--color-border-default);
  border-radius: 4px;
  background-color: #ffffff;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: all 0.15s ease;
}

.checkbox-control:hover {
  border-color: var(--color-brand-secondary);
}

.checkbox-control:checked {
  background-color: var(--color-brand-accent);
  border-color: var(--color-brand-accent);
}

.checkbox-control::after {
  content: "";
  width: 6px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  margin-top: -2px;
  transition: transform 0.15s ease-in-out;
}

.checkbox-control:checked::after {
  transform: rotate(45deg) scale(1);
}

.checkbox-control:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}
