/* ==========================================================================
  INSTITUTION SELECTOR — CSS DESIGN TOKENS
   ========================================================================== */

:root {
  /* --- Core Palette --- */
  --color-bg-start:               #07112b;
  --color-bg-end:                 #0a1f4e;
  --color-bg-mid:                 #091640;
  --color-bg-footer:              #060e1f;
  
  /* --- Gold Accent --- */
  --color-accent:                 #c9913a;
  --color-accent-dark:            #a0722a;
  --color-accent-light:           #d9a34a;
  --color-accent-rgb:             201, 145, 58;
  --color-accent-glow:            rgba(201, 145, 58, 0.35);
  --color-accent-soft:            rgba(201, 145, 58, 0.12);
  --color-accent-border:          rgba(201, 145, 58, 0.22);
  --color-accent-dim:             rgba(200, 146, 61, 0.28);
  --color-accent-strong:          rgba(200, 146, 61, 0.5);
  --color-accent-ultra-soft:      rgba(200, 146, 61, 0.05);
  --color-accent-semi:            rgba(200, 146, 61, 0.3);
  --color-accent-semi-strong:     rgba(200, 146, 61, 0.4);
  
  /* --- Grid & Overlay Colors --- */
  --color-grid-line:              rgba(201, 145, 58, 0.035);
  --color-radial-overlay:        rgba(5, 10, 25, 0.55);
  --color-corner-radiance:       radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
  
  /* --- Input Backgrounds --- */
  --color-input-bg:               rgba(240, 234, 216, 0.06);
  --color-input-focus-bg:         rgba(201, 145, 58, 0.07);
  --color-input-placeholder:      rgba(240, 234, 216, 0.3);
  
  /* --- Text Colors --- */
  --color-text-primary:           #f0ead8;
  --color-text-secondary:         #131312;
  --color-text-muted:             rgba(240, 234, 216, 0.55);
  --color-text-faint:             rgba(240, 234, 216, 0.3);
  
  /* --- Surfaces & Borders --- */
  --color-surface:                rgba(255, 255, 255, 0.04);
  --color-surface-hover:          rgba(255, 255, 255, 0.08);
  --color-border:                 rgba(201, 145, 58, 0.18);
  --color-border-hover:           rgba(201, 145, 58, 0.45);
  --color-border-gold-light:      rgba(200, 146, 61, 0.16);
  --color-border-gold-mid:        rgba(200, 146, 61, 0.3);
  --color-border-gold-strong:     rgba(200, 146, 61, 0.5);
  --color-copyright-border:       rgba(240, 234, 216, 0.06);
  
  /* --- Error States --- */
  --color-error:                  #e05252;
  --color-error-glow:             rgba(224, 82, 82, 0.4);
  --color-error-soft:             rgba(224, 82, 82, 0.1);
  
  /* --- Success Color --- */
  --color-success:                #48bb78;
  --color-success-shadow:         rgba(72, 187, 120, 0.1);
  
  /* --- Info Color --- */
  --color-blue:                   #45caff;
  --color-blue-rgb:               69, 202, 255;
  --color-blue-glow:              rgba(69, 202, 255, 0.6);
  --color-blue-soft:              rgba(69, 202, 255, 0.1);
  --color-blue-border:            rgba(69, 202, 255, 0.4);
  
  /* --- Journal Card Colors --- */
  --color-journal-bg:             rgba(240, 234, 216, 0.07);
  
  /* --- Logic Gate Colors --- */
  --color-logic-gate-bg:          rgba(201, 145, 58, 0.10);
  
  /* --- Button Gradient Overlay --- */
  --color-btn-overlay:            linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.18) 100%);
  
  /* --- Typography --- */
  --font-primary:                 'Montserrat', sans-serif;
  --font-serif:                   'Cormorant Garant', 'Georgia', serif;

  /* --- Spacing --- */
  --sp-xs:                        0.4rem;
  --sp-sm:                        0.75rem;
  --sp-md:                        1.25rem;
  --sp-lg:                        2rem;
  --sp-xl:                        3rem;

  /* --- Radius --- */
  --radius-sm:                    6px;
  --radius-md:                    12px;
  --radius-lg:                    20px;
  --radius-pill:                  50px;

  /* --- Shadows --- */
  --shadow-card:                  0 24px 60px rgba(0, 0, 0, 0.50);
  --shadow-input:                 0 0 0 3px var(--color-accent-glow);
  --shadow-btn:                   0 6px 24px rgba(201, 145, 58, 0.35);
  --shadow-btn-hover:             0 10px 32px rgba(201, 145, 58, 0.50);
  --shadow-gold:                  0 4px 20px rgba(201, 145, 58, 0.30);
  --shadow-dropdown:              0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-book:                  0 3px 10px rgba(0, 0, 0, 0.3);
  
  /* --- Notification Shadows & Colors --- */
  --shadow-notification:          0 12px 28px rgba(0, 0, 0, 0.25);
  --color-notification-bg:        linear-gradient(135deg, rgba(7, 17, 43, 0.95) 0%, rgba(10, 31, 78, 0.95) 100%);
  --notification-gold-shadow:     rgba(201, 145, 58, 0.4);
  --notification-error-shadow:    rgba(224, 82, 82, 0.4);
  --notification-info-shadow:     rgba(69, 202, 255, 0.4);
  
  /* --- Animation Backgrounds --- */
  --color-circuit-grid:           rgba(201, 145, 58, 0.05);
  --color-binary-rain:            rgba(201, 145, 58, 0.12);
  
  /* --- Book Gradients --- */
  --book-1-gradient:              linear-gradient(90deg, #8b5e2a, var(--color-accent));
  --book-2-gradient:              linear-gradient(90deg, #0c4a7a, #185fa5);
  --book-3-gradient:              linear-gradient(90deg, #1a6040, #2a8a5a);
  
  /* --- Disabled Button State --- */
  --color-btn-disabled-bg:        rgba(240, 234, 216, 0.10);
  
  /* --- Spinner Colors --- */
  --spinner-border:               rgba(7, 17, 43, 0.25);
  
  /* --- Motion --- */
  --ease-cinematic:               cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring:                  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:                     cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast:                0.2s;
  --duration-base:                0.4s;
  --duration-medium:              0.3s;
  --duration-long:                0.5s;
  --duration-slow:                0.8s;
  --duration-epic:                1.2s;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(150deg, var(--color-bg-start) 0%, var(--color-bg-mid) 100%);
  position: relative;
  overflow: hidden;
  color: var(--color-text-primary);
}

/* Page-level background grid — matches main page system */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--color-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse 75% 65% at 50% 50%,
    transparent 0%,
    var(--color-radial-overlay) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ============================================================
   MAIN CARD
   ============================================================ */
.main-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 620px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-accent-border);
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.6s var(--ease-out);
}

.main-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   LEFT — FORM SECTION
   ============================================================ */
.form-section {
  padding: 50px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--color-bg-start);
  position: relative;
  overflow: hidden;
}

/* Decorative corner radiance */
.form-section::before {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: var(--color-corner-radiance);
  pointer-events: none;
}

/* ---- Brand header ---- */
.form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 2rem;
  color: var(--color-accent);
  animation: iconFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 10px var(--color-accent-glow));
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%       { transform: translateY(-6px) rotate(2deg); }
}

.brand h1 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: 0.04em;
  line-height: 1;
}

.brand h1 em {
  color: var(--color-accent);
  font-style: normal;
}

.brand p {
  display: none;
}

/* ---- Help / Tutorial links ---- */
.help-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.help-link,
.tutorial-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text-muted);
  transition: color var(--duration-fast);
  cursor: pointer;
}

.help-link i,
.tutorial-link i {
  font-size: 0.9rem;
  color: var(--color-accent);
  opacity: 0.8;
  transition: opacity var(--duration-fast);
}

.help-link:hover,
.tutorial-link:hover {
  color: var(--color-text-primary);
}

.help-link:hover i,
.tutorial-link:hover i {
  opacity: 1;
}

/* ---- Welcome block ---- */
.form-welcome {
  margin-bottom: 2rem;
  animation: textRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

@keyframes textRise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-welcome-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  opacity: 0.70;
  margin-bottom: 0.4rem;
}

.form-welcome-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: 0.01em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.form-welcome-sub {
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--color-text-muted);
  max-width: 340px;
}

/* ---- Form ---- */
.login-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.6rem;
}

/* ---- Input wrapper ---- */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* Left icon */
.input-wrapper > i:first-child {
  position: absolute;
  left: 16px;
  color: var(--color-accent);
  font-size: 0.95rem;
  opacity: 0.75;
  pointer-events: none;
  z-index: 1;
  transition: opacity var(--duration-fast);
}

.input-wrapper:focus-within > i:first-child {
  opacity: 1;
}

/* Input base styles */
.input-wrapper input {
  width: 100%;
  padding: 14px 90px 14px 44px;
  background: var(--color-input-bg);
  border: 1px solid var(--color-accent-border);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-primary);
  transition: all var(--duration-base);
  outline: none;
}

/* Input validation states */
#institution {
  transition: all 0.2s ease;
}

#institution.valid {
  border-color: var(--color-success);
  box-shadow: 0 0 0 3px var(--color-success-shadow);
}

#institution.invalid {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px var(--color-error-soft);
}

#institution.error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px var(--color-error-soft);
}

.input-wrapper input::placeholder {
  color: var(--color-input-placeholder);
  font-weight: 400;
}

.input-wrapper input:focus {
  border-color: var(--color-accent);
  background: var(--color-input-focus-bg);
  box-shadow: var(--shadow-input);
}

/* Dropdown toggle */
.dropdown-toggle {
  position: absolute;
  right: 42px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  transition: transform var(--duration-fast);
}

.dropdown-toggle i {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  transition: color var(--duration-fast), transform 0.25s ease;
}

.dropdown-toggle:hover i { color: var(--color-accent); }
.dropdown-toggle.open i  { transform: rotate(180deg); color: var(--color-accent); }

/* Clear button */
.clear-institution {
  position: absolute;
  right: 70px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
}

.clear-institution i {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  transition: color var(--duration-fast);
}

.clear-institution:hover i { color: var(--color-error); }

/* Dropdown list */
.institution-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-bg-mid);
  border: 1px solid var(--color-accent-border);
  border-radius: var(--radius-md);
  max-height: 210px;
  overflow-y: auto;
  z-index: 50;
  list-style: none;
  padding: 6px 0;
  box-shadow: var(--shadow-dropdown);
}

.institution-dropdown::-webkit-scrollbar { width: 4px; }
.institution-dropdown::-webkit-scrollbar-track { background: transparent; }
.institution-dropdown::-webkit-scrollbar-thumb {
  background: var(--color-border-gold-light);
  border-radius: 2px;
}

.institution-dropdown li {
  padding: 11px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--duration-fast);
  display: flex;
  align-items: center;
  gap: 10px;
}

.institution-dropdown li:hover {
  background: var(--color-accent-soft);
  color: var(--color-text-primary);
  padding-left: 20px;
}

.institution-dropdown li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0;
  flex-shrink: 0;
  transition: opacity var(--duration-fast);
}

.institution-dropdown li:hover::before { opacity: 1; }

/* Error message */
.form-error-message {
  display: none;
  color: var(--color-error);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: 6px;
  padding-left: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.form-error-message::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: var(--color-error);
  color: var(--color-text-primary);
  border-radius: 50%;
  font-size: 10px;
  font-weight: bold;
}

/* ---- Submit button ---- */
.submit-btn {
  width: 100%;
  padding: 15px 30px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--duration-base);
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
  color: var(--color-bg-start);
  box-shadow: var(--shadow-btn);
}

.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-btn-overlay);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.submit-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hover);
}

.submit-btn:not(:disabled):hover::before { opacity: 1; }
.submit-btn:not(:disabled):active { transform: translateY(0); }

.submit-btn:disabled {
  background: var(--color-btn-disabled-bg);
  color: var(--color-text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-text { position: relative; z-index: 1; }

.btn-loader {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--spinner-border);
  border-top-color: var(--color-bg-start);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Form message & tagline ---- */
.form-message {
  margin-top: 1.5rem;
  text-align: center;
}

.form-message p {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  opacity: 0.75;
}

/* ---- Copyright ---- */
.copyright-notice {
  margin-top: 2rem;
  text-align: center;
  border-top: 1px solid var(--color-copyright-border);
  padding-top: 1.25rem;
}

.copyright-notice p {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-text-muted);
  opacity: 0.6;
  letter-spacing: 0.04em;
}

/* ============================================================
   RIGHT — ANIMATION SECTION
   ============================================================ */
.animation-section {
  background: linear-gradient(150deg, var(--color-bg-mid) 0%, var(--color-bg-end) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-left: 1px solid var(--color-accent-border);
}

/* Gold circuit grid on right panel */
.animation-section::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-circuit-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-circuit-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.logic-animation {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Books Stack ---- */
.educational-elements {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.books-stack {
  position: absolute;
  top: 15%;
  left: 12%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.book {
  width: 72px;
  height: 10px;
  border-radius: 2px;
  position: relative;
  animation: bookFloat 4s ease-in-out infinite;
  box-shadow: var(--shadow-book);
}

.book-1 { background: var(--book-1-gradient); animation-delay: 0s; }
.book-2 { background: var(--book-2-gradient); animation-delay: 0.5s; width: 80px; }
.book-3 { background: var(--book-3-gradient); animation-delay: 1s; width: 64px; }

.book-spine {
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 100%;
  border-radius: 2px 0 0 2px;
  background: rgba(0,0,0,0.25);
}

@keyframes bookFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ---- Floating Journal cards ---- */
.journal {
  position: absolute;
  background: var(--color-journal-bg);
  border: 1px solid var(--color-accent-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  animation: journalFloat 6s ease-in-out infinite;
  backdrop-filter: blur(4px);
}

.journal i {
  font-size: 1.1rem;
  color: var(--color-accent);
  opacity: 0.85;
}

.journal-1 { top: 22%; right: 18%; animation-delay: 0s; }
.journal-2 { top: 52%; right: 56%; animation-delay: 2s; }
.journal-3 { bottom: 12%; right: 22%; animation-delay: 4s; }

@keyframes journalFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); opacity: 0.7; }
  50%       { transform: translateY(-14px) rotate(1deg); opacity: 1; }
}

/* ---- Knowledge particles ---- */
.knowledge-particles {
  position: absolute;
  inset: 0;
}

.particle {
  position: absolute;
  font-size: 1.4rem;
  opacity: 0;
  animation: particleRise 9s linear infinite;
  filter: drop-shadow(0 0 6px var(--color-accent-glow));
}

.particle:nth-child(1) { top: 80%; left: 10%;  animation-delay: 0s; }
.particle:nth-child(2) { top: 75%; left: 80%;  animation-delay: 1.8s; }
.particle:nth-child(3) { top: 85%; left: 30%;  animation-delay: 3.6s; }
.particle:nth-child(4) { top: 70%; left: 65%;  animation-delay: 5.4s; }
.particle:nth-child(5) { top: 78%; left: 48%;  animation-delay: 7.2s; }

@keyframes particleRise {
  0%   { transform: translateY(0) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.5; }
  100% { transform: translateY(-380px) rotate(180deg); opacity: 0; }
}

/* ---- Circuit lines ---- */
.circuit-board {
  position: absolute;
  width: 80%;
  height: 80%;
}

.circuit-line {
  position: absolute;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  animation: linePulse 3.5s ease-in-out infinite;
}

.line-1 { top: 20%; left: 10%; width: 80%; animation-delay: 0s; }
.line-2 { top: 40%; left: 20%; width: 60%; animation-delay: 0.7s; }
.line-3 { top: 60%; left: 15%; width: 70%; animation-delay: 1.4s; }
.line-4 { top: 80%; left: 25%; width: 50%; animation-delay: 2.1s; }

@keyframes linePulse {
  0%, 100% { opacity: 0.15; }
  50%       { opacity: 0.65; }
}

/* ---- Logic gate badges ---- */
.logic-gate {
  position: absolute;
  background: var(--color-logic-gate-bg);
  border: 1px solid var(--color-accent-border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: var(--font-primary);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  white-space: nowrap;
  animation: gatePulse 2.5s ease-in-out infinite;
}

.gate-1 { top: 15%; left: 28%; animation-delay: 0s; }
.gate-2 { top: 42%; right: 20%; animation-delay: 0.8s; }
.gate-3 { bottom: 22%; left: 38%; animation-delay: 1.6s; }

@keyframes gatePulse {
  0%, 100% { box-shadow: none; border-color: var(--color-accent-border); }
  50%       { box-shadow: 0 0 16px var(--color-accent-glow); border-color: var(--color-accent); }
}

/* ---- Moving data packets ---- */
.data-packet {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.7;
  box-shadow: 0 0 8px var(--color-accent-glow);
}

.packet-1 { top: 20%; left: 10%; animation: moveAlong 5s linear infinite; }
.packet-2 { top: 40%; left: 20%; animation: moveAlong 5s linear infinite 1.2s; }
.packet-3 { top: 60%; left: 15%; animation: moveAlong 5s linear infinite 2.8s; }

@keyframes moveAlong {
  0%   { transform: translateX(0);    opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.6; }
  100% { transform: translateX(280px); opacity: 0; }
}

/* ---- Binary rain ---- */
.binary-rain {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 20px;
  opacity: 0.12;
  pointer-events: none;
  overflow: hidden;
}

.binary-rain span {
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-accent);
  animation: binaryFall 7s linear infinite;
}

.binary-rain span:nth-child(odd)  { animation-delay: 0s; }
.binary-rain span:nth-child(even) { animation-delay: 3.5s; }

@keyframes binaryFall {
  0%   { transform: translateY(-20px); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(460px); opacity: 0; }
}

/* ---- Central learning icon ---- */
.learning-icon {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.learning-icon i {
  font-size: 3.8rem;
  color: var(--color-accent);
  filter: drop-shadow(0 0 18px var(--color-accent-glow));
  animation: brainPulse 3s ease-in-out infinite;
}

@keyframes brainPulse {
  0%, 100% { filter: drop-shadow(0 0 14px var(--color-accent-glow));    transform: scale(1); }
  50%       { filter: drop-shadow(0 0 30px var(--color-accent-strong)); transform: scale(1.06); }
}

.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 1.5px solid var(--color-accent-border);
  animation: ringExpand 2.4s ease-out infinite;
}

.pulse-ring:nth-child(2) { animation-delay: 0.8s; }
.pulse-ring:nth-child(3) { animation-delay: 1.6s; }

@keyframes ringExpand {
  0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; }
}

/* ============================================================
   NOTIFICATION STYLES (Unified with main page)
   ============================================================ */

.notification {
  position: fixed;
  top: 24px;
  right: 24px;
  min-width: 320px;
  max-width: 420px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 1001;
  transform: translateX(calc(100% + 30px));
  transition: transform 0.4s var(--ease-out);
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-notification);
  cursor: default;
  pointer-events: auto;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  background: var(--color-notification-bg);
  border-left: 4px solid var(--color-accent);
  color: var(--color-text-primary);
}

.notification.success i {
  color: var(--color-accent);
  font-size: 1.25rem;
  filter: drop-shadow(0 0 6px var(--notification-gold-shadow));
}

.notification.error {
  background: var(--color-notification-bg);
  border-left: 4px solid var(--color-error);
  color: var(--color-text-primary);
}

.notification.error i {
  color: var(--color-error);
  font-size: 1.25rem;
  filter: drop-shadow(0 0 6px var(--notification-error-shadow));
}

.notification.info {
  background: var(--color-notification-bg);
  border-left: 4px solid var(--color-blue);
  color: var(--color-text-primary);
}

.notification.info i {
  color: var(--color-blue);
  font-size: 1.25rem;
  filter: drop-shadow(0 0 6px var(--notification-info-shadow));
}

.notification i:first-child {
  flex-shrink: 0;
}

.notification span {
  flex: 1;
  letter-spacing: 0.02em;
}

/* Close button for notifications */
.notification-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px;
  margin: -4px -4px -4px 0;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  border-radius: var(--radius-sm);
}

.notification-close:hover {
  opacity: 1;
}

/* Notification container for multiple notifications */
.notification-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.notification-container .notification {
  position: relative;
  top: auto;
  right: auto;
  margin-top: 0;
}

/* ============================================================
   RESPONSIVE STYLES
   ============================================================ */

/* Tablet & Mobile Breakpoint - Hide animation section, stack layout */
@media (max-width: 900px) {
  .main-card {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
    min-height: auto;
  }

  .animation-section {
    display: none;
  }

  .form-section {
    min-height: auto;
    max-height: none;
    overflow: visible;
  }
}

/* Mobile landscape optimization */
@media (max-width: 768px) and (orientation: landscape) {
  body {
    overflow-y: auto;
  }
  
  .main-card {
    min-height: auto;
  }
  
  .form-section {
    padding: 30px 40px;
  }
}

/* Small Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
  body {
    padding: 12px;
    overflow-y: auto;
  }

  .main-card {
    border-radius: var(--radius-md);
  }

  .form-section {
    padding: 32px 24px;
  }

  .form-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 1.5rem;
  }

  .help-links {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .brand-icon {
    font-size: 1.6rem;
  }

  .brand h1 {
    font-size: 1.3rem;
  }

  .form-welcome {
    margin-bottom: 1.5rem;
  }

  .form-welcome-label {
    font-size: 0.6rem;
  }

  .form-welcome-title {
    font-size: 1.3rem;
  }

  .form-welcome-sub {
    font-size: 0.75rem;
  }

  .form-group {
    margin-bottom: 1.2rem;
  }

  .form-group label {
    font-size: 0.65rem;
    margin-bottom: 0.5rem;
  }

  .input-wrapper input {
    padding: 12px 80px 12px 40px;
    font-size: 0.85rem;
  }

  .input-wrapper > i:first-child {
    left: 14px;
    font-size: 0.85rem;
  }

  .dropdown-toggle {
    right: 38px;
    padding: 8px;
  }

  .clear-institution {
    right: 65px;
    padding: 8px;
  }

  .institution-dropdown {
    max-height: 160px;
  }

  .institution-dropdown li {
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .submit-btn {
    padding: 12px 24px;
    font-size: 0.8rem;
  }

  .spinner {
    width: 18px;
    height: 18px;
  }

  .form-message {
    margin-top: 1.2rem;
  }

  .form-message p {
    font-size: 0.7rem;
  }

  .copyright-notice {
    margin-top: 1.5rem;
    padding-top: 1rem;
  }

  .copyright-notice p {
    font-size: 0.65rem;
  }

  /* Mobile notification adjustments */
  .notification {
    min-width: 280px;
    max-width: calc(100vw - 32px);
    top: 16px;
    right: 16px;
    padding: 14px 16px;
    font-size: 0.8125rem;
  }
  
  .notification i:first-child {
    font-size: 1.1rem;
  }

  .notification-container {
    top: 16px;
    right: 16px;
  }
}

/* Extra small devices (max-width: 360px) */
@media (max-width: 360px) {
  .form-section {
    padding: 24px 18px;
  }

  .brand h1 {
    font-size: 1.2rem;
  }

  .form-welcome-title {
    font-size: 1.2rem;
  }

  .input-wrapper input {
    padding: 11px 70px 11px 38px;
    font-size: 0.8rem;
  }

  .dropdown-toggle {
    right: 32px;
  }

  .clear-institution {
    right: 58px;
  }
}

/* Touch-friendly improvements for all mobile devices */
@media (max-width: 768px) {
  .dropdown-toggle,
  .clear-institution,
  .institution-dropdown li,
  .submit-btn,
  .help-link,
  .tutorial-link,
  .notification-close {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .submit-btn:active {
    transform: scale(0.97);
  }

  .form-group {
    position: relative;
  }

  .institution-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .notification,
  .main-card,
  .book,
  .journal,
  .particle,
  .circuit-line,
  .logic-gate,
  .data-packet,
  .binary-rain span,
  .learning-icon i,
  .pulse-ring {
    animation: none;
    transition: none;
  }
  
  .main-card {
    opacity: 1;
    transform: none;
  }
}