/* ============================================
   AIIMS Conference — Design System v2.0
   Premium Light Theme · 60-30-10 Rule
   60% → White / Pearl (#F7F8FC)
   30% → Cool Gray (#EEF0F6, #D1D5E0)
   10% → Indigo Accent (#4F46E5)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* ─── Primary Palette (10% accent) ─── */
  --accent: #4F46E5;
  --accent-hover: #4338CA;
  --accent-light: #EEF2FF;
  --accent-glow: rgba(79, 70, 229, 0.12);
  --accent-shadow: rgba(79, 70, 229, 0.25);

  /* ─── Semantic Colors ─── */
  --success: #10B981;
  --success-light: #ECFDF5;
  --success-dark: #059669;

  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --warning-dark: #D97706;

  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --danger-dark: #DC2626;

  --info: #3B82F6;
  --info-light: #EFF6FF;
  --info-dark: #2563EB;

  /* ─── Neutral Scale (60% + 30%) ─── */
  --white: #FFFFFF;
  --gray-25: #FCFCFD;
  --gray-50: #F7F8FC;
  --gray-100: #EEF0F6;
  --gray-200: #D1D5E0;
  --gray-300: #B0B7C8;
  --gray-400: #8A93A6;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --gray-950: #0A0E1A;

  /* ─── Surface Colors ─── */
  --surface-page: var(--gray-50);
  --surface-card: var(--white);
  --surface-raised: var(--white);
  --surface-sunken: var(--gray-100);
  --surface-overlay: rgba(17, 24, 39, 0.4);

  /* ─── Border Colors ─── */
  --border-light: var(--gray-100);
  --border-default: var(--gray-200);
  --border-strong: var(--gray-300);
  --border-focus: var(--accent);

  /* ─── Typography ─── */
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;

  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.8125rem;   /* 13px */
  --text-base: 0.9375rem; /* 15px */
  --text-md: 1rem;        /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  --text-5xl: 3rem;       /* 48px */

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;

  /* ─── Spacing ─── */
  --sp-0: 0;
  --sp-1: 0.25rem;
  --sp-1h: 0.375rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* legacy spacing aliases */
  --space-1: var(--sp-1);
  --space-2: var(--sp-2);
  --space-3: var(--sp-3);
  --space-4: var(--sp-4);
  --space-5: var(--sp-5);
  --space-6: var(--sp-6);
  --space-8: var(--sp-8);
  --space-10: var(--sp-10);
  --space-12: var(--sp-12);
  --space-16: var(--sp-16);
  --space-20: var(--sp-20);

  /* ─── Border Radius ─── */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-3xl: 32px;
  --radius-full: 9999px;

  /* ─── Shadows ─── */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.03);
  --shadow-card-hover: 0 1px 3px rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.06);
  --shadow-accent: 0 4px 14px var(--accent-shadow);
  --shadow-float: 0 24px 48px rgba(0, 0, 0, 0.08);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.04);

  /* ─── Transitions ─── */
  --ease-out: cubic-bezier(0.0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 350ms;
  --duration-slower: 500ms;

  --transition-fast: var(--duration-fast) var(--ease-out);
  --transition-base: var(--duration-base) var(--ease-out);
  --transition-slow: var(--duration-slow) var(--ease-out);
  --transition-spring: var(--duration-slower) var(--ease-spring);

  /* ─── Z-Index ─── */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* Legacy variable mapping for JS compatibility */
  --color-google-blue: var(--accent);
  --color-google-blue-light: var(--accent-light);
  --color-google-blue-hover: var(--accent-hover);
  --color-google-green: var(--success);
  --color-google-green-light: var(--success-light);
  --color-google-green-hover: var(--success-dark);
  --color-google-yellow: var(--warning);
  --color-google-yellow-light: var(--warning-light);
  --color-google-red: var(--danger);
  --color-google-red-light: var(--danger-light);
  --color-google-red-hover: var(--danger-dark);
  --color-white: var(--white);
  --color-gray-50: var(--gray-50);
  --color-gray-100: var(--gray-100);
  --color-gray-200: var(--gray-200);
  --color-gray-300: var(--gray-300);
  --color-gray-400: var(--gray-400);
  --color-gray-500: var(--gray-500);
  --color-gray-600: var(--gray-600);
  --color-gray-700: var(--gray-700);
  --color-gray-800: var(--gray-800);
  --color-gray-900: var(--gray-900);
  --color-navy-900: var(--gray-50);
  --color-navy-800: var(--white);
  --color-navy-700: var(--gray-100);
  --color-navy-600: var(--gray-200);
  --color-navy-500: var(--gray-300);
  --color-navy-400: var(--gray-400);
  --color-navy-300: var(--gray-500);
  --color-teal-500: var(--accent);
  --color-teal-400: var(--accent);
  --color-teal-300: var(--accent-light);
  --color-teal-600: var(--accent-hover);
  --color-teal-glow: var(--accent-glow);
  --color-gold-500: var(--accent);
  --color-gold-400: var(--accent);
  --color-gold-300: var(--accent-light);
  --color-gold-600: var(--accent-hover);
  --color-gold-glow: var(--accent-glow);
  --color-emerald-500: var(--success);
  --color-emerald-400: var(--success);
  --color-emerald-glow: rgba(16, 185, 129, 0.15);
  --color-rose-500: var(--danger);
  --color-rose-400: var(--danger);
  --color-rose-glow: rgba(239, 68, 68, 0.15);
  --glass-bg: var(--white);
  --glass-bg-light: var(--gray-50);
  --glass-border: var(--gray-200);
  --glass-border-hover: var(--gray-300);
  --glass-blur: 0px;
  --font-heading: var(--font-display);
  --font-size-xs: var(--text-xs);
  --font-size-sm: var(--text-sm);
  --font-size-base: var(--text-base);
  --font-size-lg: var(--text-lg);
  --font-size-xl: var(--text-xl);
  --font-size-2xl: var(--text-2xl);
  --font-size-3xl: var(--text-3xl);
  --font-size-4xl: var(--text-4xl);
  --font-size-5xl: var(--text-5xl);
  --shadow-teal: var(--shadow-accent);
  --shadow-gold: var(--shadow-accent);
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--gray-700);
  background: var(--surface-page);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle page texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 80% at 50% -20%, rgba(79, 70, 229, 0.03) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(16, 185, 129, 0.02) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gray-900);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p {
  color: var(--gray-500);
  line-height: var(--leading-relaxed);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

/* ── Form Elements ── */
.form-group {
  position: relative;
  margin-bottom: var(--sp-5);
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--sp-2);
  letter-spacing: var(--tracking-wide);
}

.form-group label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  padding: var(--sp-3) var(--sp-4);
  background: var(--white);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--gray-800);
  font-family: var(--font-body);
  font-size: var(--text-base);
  transition: all var(--transition-base);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--gray-400);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--border-strong);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-4) center;
  padding-right: var(--sp-10);
  cursor: pointer;
}

.form-select option {
  background: var(--white);
  color: var(--gray-800);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-helper {
  display: block;
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-top: var(--sp-1h);
}

.form-error {
  display: none;
  font-size: var(--text-xs);
  color: var(--danger);
  margin-top: var(--sp-1);
  align-items: center;
  gap: var(--sp-1);
}

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

.form-error svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Inline form row */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Radio / Checkbox Pill Chips */
.radio-group,
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-default);
  background: var(--white);
  transition: all var(--transition-base);
  font-size: var(--text-sm);
  color: var(--gray-600);
  font-weight: 500;
  user-select: none;
}

.radio-option:hover,
.checkbox-option:hover {
  border-color: var(--border-strong);
  background: var(--gray-50);
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  transition: all var(--transition-fast);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-option input[type="checkbox"] {
  border-radius: 5px;
}

.radio-option input[type="radio"]:checked,
.checkbox-option input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.radio-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--white);
}

.checkbox-option input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  color: var(--white);
  font-weight: 700;
}

.radio-option:has(input:checked),
.checkbox-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-hover);
  box-shadow: 0 1px 4px var(--accent-glow);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: var(--tracking-wide);
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.2) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}

.btn:active::after {
  opacity: 1;
  transition: opacity 0s;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-shadow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--white);
  border: 1.5px solid var(--border-default);
  color: var(--gray-700);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--gray-50);
  color: var(--gray-900);
}

.btn-gold {
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--shadow-accent);
}

.btn-gold:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-shadow);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-danger:hover {
  background: var(--danger-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-500);
  padding: var(--sp-2) var(--sp-3);
}

.btn-ghost:hover {
  color: var(--gray-900);
  background: var(--gray-100);
}

.btn-lg {
  padding: var(--sp-4) var(--sp-8);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: var(--sp-1h) var(--sp-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Loading Spinner */
.btn .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ── Utility Classes ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-muted { color: var(--gray-400); }
.text-teal { color: var(--accent); }
.text-gold { color: var(--accent); }
.text-rose { color: var(--danger); }
.text-emerald { color: var(--success); }

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }

.hidden { display: none !important; }

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes checkmark {
  0% { stroke-dashoffset: 50; }
  100% { stroke-dashoffset: 0; }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-fadeIn { animation: fadeIn 0.4s var(--ease-out); }
.animate-fadeInUp { animation: fadeInUp 0.45s var(--ease-out); }
.animate-fadeInDown { animation: fadeInDown 0.35s var(--ease-out); }
.animate-scaleIn { animation: scaleIn 0.35s var(--ease-spring); }
.animate-pulse { animation: pulse 2s infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.4s var(--ease-out) forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.04s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.08s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.12s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.16s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.20s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.24s; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ── Selection ── */
::selection {
  background: var(--accent);
  color: var(--white);
}

/* ── Focus Visible ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
  :root {
    --text-4xl: 1.875rem;
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
  }
}

@media (max-width: 480px) {
  :root {
    --text-4xl: 1.5rem;
    --text-3xl: 1.25rem;
    --text-2xl: 1.125rem;
  }
}
