.atena-forum-link-modal {
  --aflm-teal:   #17a2b8;
  --aflm-purple: #6f42c1;
  --aflm-orange: #e8693a;
  --aflm-ink-1:  #0a1428;
  --aflm-ink-2:  #2d3950;
  --aflm-ink-3:  #6b7891;
  --aflm-ink-4:  #a0aabe;
  --aflm-error:  #d33b4d;
  --aflm-success:#20a880;
  --aflm-glass-strong: rgba(255, 255, 255, 0.92);
  --aflm-glass-border: rgba(255, 255, 255, 0.85);

  position: fixed; inset: 0;
  z-index: 99997;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Manrope', system-ui, sans-serif;
  padding: 20px;
}
.atena-forum-link-modal.open { display: flex; }
.atena-forum-link-modal * { box-sizing: border-box; }

.aflm-backdrop {
  position: absolute; inset: 0;
  background:
    radial-gradient(800px 600px at 18% 22%, rgba(23, 162, 184, 0.2), transparent 60%),
    radial-gradient(700px 600px at 85% 78%, rgba(111, 66, 193, 0.2), transparent 60%),
    rgba(10, 20, 40, 0.55);
  backdrop-filter: blur(24px) saturate(180%);
  animation: aflmFade 0.4s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes aflmFade { from{opacity:0;} to{opacity:1;} }

.aflm-card {
  position: relative; z-index: 2;
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 40px);
  background: var(--aflm-glass-strong);
  border: 1px solid var(--aflm-glass-border);
  border-radius: 28px;
  backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 50px 100px -20px rgba(10, 20, 40, 0.4), inset 0 1px 0 rgba(255,255,255,0.95);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: aflmIn 0.5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes aflmIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.aflm-head { padding: 22px 24px 0; flex-shrink: 0; }
.aflm-head-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 16px;
}
.aflm-brand { display: flex; align-items: center; gap: 11px; }
.aflm-brand-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: url('./images/FORUM/logos/logos.png') center/cover no-repeat;
  border: 2px solid rgba(255,255,255,0.6);
  box-shadow: 0 6px 16px -4px rgba(111, 66, 193, 0.45);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.aflm-brand-mark::after { display: none; }
.aflm-brand-text { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; color: var(--aflm-ink-1); }
.aflm-brand-text em { font-style: normal; color: var(--aflm-purple); }
.aflm-brand-sub {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--aflm-purple);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

.aflm-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(10,20,40,0.08);
  background: rgba(255,255,255,0.6);
  color: var(--aflm-ink-2);
  cursor: pointer;
  display: grid; place-items: center;
  transition: 0.2s;
}
.aflm-close:hover { background: rgba(255,255,255,1); }
.aflm-close svg { width: 13px; height: 13px; }

.aflm-progress {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px 14px;
}
.aflm-pd {
  flex: 1;
  height: 4px;
  border-radius: 100px;
  background: rgba(10, 20, 40, 0.08);
  transition: 0.4s cubic-bezier(.2,.8,.2,1);
}
.aflm-pd.done, .aflm-pd.active {
  background: linear-gradient(135deg, var(--aflm-teal), var(--aflm-purple));
}
.aflm-pd.active { box-shadow: 0 0 10px rgba(111, 66, 193, 0.5); }

.aflm-body {
  padding: 8px 28px 24px;
  overflow-y: auto;
  flex: 1;
}

.aflm-step { display: none; }
.aflm-step.active {
  display: block;
  animation: aflmStepIn 0.4s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes aflmStepIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.aflm-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  background: rgba(111, 66, 193, 0.1);
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--aflm-purple);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.aflm-eyebrow-num {
  background: linear-gradient(135deg, var(--aflm-teal), var(--aflm-purple));
  color: white;
  padding: 2px 7px;
  border-radius: 100px;
  font-size: 9px;
}

.aflm-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--aflm-ink-1);
  line-height: 1.15;
  margin: 0 0 8px;
}
.aflm-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--aflm-teal), var(--aflm-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.aflm-sub {
  font-size: 14px;
  color: var(--aflm-ink-2);
  line-height: 1.55;
  margin: 0 0 20px;
}

.aflm-choices {
  display: flex; flex-direction: column;
  gap: 10px;
}
.aflm-choice {
  width: 100%;
  padding: 16px 18px;
  background: white;
  border: 1.5px solid rgba(10, 20, 40, 0.08);
  border-radius: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: 0.25s cubic-bezier(.2,.8,.2,1);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
}
.aflm-choice:hover {
  border-color: var(--aflm-teal);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -8px rgba(23, 162, 184, 0.2);
}
.aflm-choice-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(23, 162, 184, 0.1);
  color: var(--aflm-teal);
  font-size: 17px;
  flex-shrink: 0;
  transition: 0.25s;
}
.aflm-choice:hover .aflm-choice-icon {
  background: linear-gradient(135deg, var(--aflm-teal), var(--aflm-purple));
  color: white;
  box-shadow: 0 8px 18px -4px rgba(111, 66, 193, 0.4);
}
.aflm-choice-text { flex: 1; min-width: 0; }
.aflm-choice-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--aflm-ink-1);
  margin-bottom: 2px;
}
.aflm-choice-sub {
  font-size: 12.5px;
  color: var(--aflm-ink-3);
  line-height: 1.4;
}
.aflm-choice-arrow {
  color: var(--aflm-ink-4);
  font-size: 13px;
  transition: 0.2s;
}
.aflm-choice:hover .aflm-choice-arrow {
  color: var(--aflm-purple);
  transform: translateX(3px);
}

.aflm-choice--synapse .aflm-choice-icon {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  position: relative;
  overflow: hidden;
}
.aflm-choice--synapse .aflm-choice-icon::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 14px;
  border: 1.5px solid rgba(167, 139, 250, 0.6);
  animation: aflmRingSpin 4s linear infinite;
}
@keyframes aflmRingSpin { to { transform: rotate(360deg); } }

.aflm-field { margin-bottom: 16px; }
.aflm-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--aflm-ink-2);
  margin-bottom: 8px;
}
.aflm-input {
  width: 100%;
  padding: 14px 16px;
  background: white;
  border: 1.5px solid rgba(10, 20, 40, 0.1);
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--aflm-ink-1);
  outline: none;
  transition: 0.2s;
}
.aflm-input:focus {
  border-color: var(--aflm-teal);
  box-shadow: 0 0 0 4px rgba(23, 162, 184, 0.12);
}
.aflm-input.aflm-code {
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-align: center;
  font-size: 17px;
}

.aflm-search-wrap { position: relative; }
.aflm-search-results {
  margin-top: 8px;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid rgba(10, 20, 40, 0.08);
  border-radius: 14px;
  background: white;
  display: none;
}
.aflm-search-results.show { display: block; }
.aflm-search-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(10, 20, 40, 0.04);
  transition: 0.15s;
}
.aflm-search-item:last-child { border-bottom: none; }
.aflm-search-item:hover { background: rgba(23, 162, 184, 0.06); }
.aflm-search-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--aflm-ink-1);
  margin-bottom: 2px;
}
.aflm-search-meta {
  font-size: 12px;
  color: var(--aflm-ink-3);
  font-family: 'JetBrains Mono', monospace;
}

.aflm-empty {
  padding: 16px;
  text-align: center;
  color: var(--aflm-ink-3);
  font-size: 13px;
}

.aflm-helper {
  font-size: 12.5px;
  color: var(--aflm-ink-3);
  margin-top: 8px;
  line-height: 1.5;
}
.aflm-helper.error { color: var(--aflm-error); }
.aflm-helper.success { color: var(--aflm-success); }

.aflm-school-card {
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(23, 162, 184, 0.06);
  border: 1px solid rgba(23, 162, 184, 0.2);
  border-radius: 14px;
  display: flex; align-items: flex-start;
  gap: 12px;
}
.aflm-school-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--aflm-teal), var(--aflm-purple));
  display: grid; place-items: center;
  color: white;
  font-size: 14px;
  flex-shrink: 0;
}
.aflm-school-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--aflm-ink-1);
  margin-bottom: 3px;
}
.aflm-school-meta {
  font-size: 12px;
  color: var(--aflm-ink-3);
  font-family: 'JetBrains Mono', monospace;
}
.aflm-school-meta b { color: var(--aflm-teal); }

.aflm-pre-school {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.06), rgba(118, 75, 162, 0.06));
  border: 1px solid rgba(111, 66, 193, 0.18);
  border-radius: 14px;
  animation: aflmFade 0.3s cubic-bezier(.2,.8,.2,1) both;
}
.aflm-pre-school-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  display: grid; place-items: center;
  font-size: 13px;
  flex-shrink: 0;
}
.aflm-pre-school-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--aflm-purple);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.aflm-pre-school-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--aflm-ink-1);
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin-top: 1px;
}

.aflm-google-slot {
  margin-top: 4px;
  padding: 6px;
  background: white;
  border: 1px solid rgba(10, 20, 40, 0.1);
  border-radius: 18px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px -6px rgba(10, 20, 40, 0.12);
}
.aflm-google-real {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
}
.aflm-google-real > div { margin: 0 auto; }

.aflm-consents { display: flex; flex-direction: column; gap: 10px; }
.aflm-consent {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(10, 20, 40, 0.08);
  border-radius: 14px;
  display: flex; align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  user-select: none;
  transition: 0.2s;
}
.aflm-consent:hover { background: rgba(255, 255, 255, 0.9); }
.aflm-consent.required { border-color: rgba(23, 162, 184, 0.25); }
.aflm-cbox {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border: 2px solid rgba(10, 20, 40, 0.2);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  transition: 0.2s;
  position: relative;
}
.aflm-cbox:checked {
  background: linear-gradient(135deg, var(--aflm-teal), var(--aflm-purple));
  border-color: transparent;
}
.aflm-cbox:checked::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 6px; height: 11px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.aflm-cbox-text { font-size: 12.5px; color: var(--aflm-ink-2); line-height: 1.5; }
.aflm-cbox-text b { color: var(--aflm-ink-1); }
.aflm-cbox-text a { color: var(--aflm-purple); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(111, 66, 193, 0.3); }
.aflm-required-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 9.5px;
  background: rgba(211, 59, 77, 0.1);
  color: var(--aflm-error);
  border-radius: 100px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}

.aflm-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.aflm-btn {
  flex: 1;
  padding: 13px 20px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: 0.25s cubic-bezier(.2,.8,.2,1);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.aflm-btn-primary {
  background: linear-gradient(135deg, var(--aflm-teal), var(--aflm-purple));
  color: white;
  box-shadow: 0 10px 22px -6px rgba(111, 66, 193, 0.4);
}
.aflm-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -6px rgba(111, 66, 193, 0.5);
}
.aflm-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.aflm-btn-ghost {
  flex: 0 0 auto;
  background: rgba(255,255,255,0.6);
  color: var(--aflm-ink-2);
  border: 1px solid rgba(10, 20, 40, 0.08);
}
.aflm-btn-ghost:hover { background: rgba(255,255,255,1); }

.aflm-alert {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 14px;
}
.aflm-alert.show { display: flex; }
.aflm-alert.error { background: rgba(211, 59, 77, 0.1); color: var(--aflm-error); }
.aflm-alert.success { background: rgba(32, 168, 128, 0.1); color: var(--aflm-success); }
.aflm-alert.info { background: rgba(23, 162, 184, 0.1); color: var(--aflm-teal); }

.aflm-loading-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 24px 24px;
}
.aflm-loading-screen.active {
  display: flex;
  animation: aflmFade 0.5s cubic-bezier(.2,.8,.2,1) both;
}
.aflm-loading-eb {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px;
  background: rgba(111, 66, 193, 0.1);
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--aflm-purple);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.aflm-led {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--aflm-purple);
  box-shadow: 0 0 10px var(--aflm-purple);
  animation: aflmPulse 1.5s infinite;
}
@keyframes aflmPulse { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:0.4;transform:scale(1.4);} }

.aflm-loading-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--aflm-ink-1);
  margin-bottom: 4px;
}
.aflm-loading-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--aflm-teal), var(--aflm-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.aflm-loading-sub {
  font-size: 13px;
  color: var(--aflm-ink-3);
  margin-bottom: 22px;
}

.aflm-school-scene {
  width: 100%; max-width: 340px;
  height: 180px;
  margin: 0 auto 20px;
}
.aflm-school-scene svg { width: 100%; height: 100%; overflow: visible; }

.aflm-prog-list {
  width: 100%;
  display: flex; flex-direction: column; gap: 8px;
}
.aflm-prog-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(10, 20, 40, 0.06);
  border-radius: 14px;
  transition: 0.4s cubic-bezier(.2,.8,.2,1);
  text-align: left;
}
.aflm-prog-item.active { background: rgba(23, 162, 184, 0.06); border-color: rgba(23, 162, 184, 0.25); }
.aflm-prog-item.done { background: rgba(32, 168, 128, 0.06); border-color: rgba(32, 168, 128, 0.25); }
.aflm-prog-icon {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(10, 20, 40, 0.08);
  color: var(--aflm-ink-3);
  font-size: 10.5px; font-weight: 700;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
  transition: 0.4s;
}
.aflm-prog-item.active .aflm-prog-icon {
  background: linear-gradient(135deg, var(--aflm-teal), var(--aflm-purple));
  color: white;
  animation: aflmProgPulse 1.4s ease-in-out infinite;
}
.aflm-prog-item.done .aflm-prog-icon { background: var(--aflm-success); color: white; }
.aflm-prog-item.done .aflm-prog-icon::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 11px;
}
.aflm-prog-item.done .aflm-prog-num { display: none; }
@keyframes aflmProgPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.aflm-prog-text {
  flex: 1;
  font-size: 13px;
  color: var(--aflm-ink-2);
  font-weight: 500;
}
.aflm-prog-item.active .aflm-prog-text, .aflm-prog-item.done .aflm-prog-text { color: var(--aflm-ink-1); font-weight: 600; }

.aflm-student {
  animation: aflmWalk 6s linear infinite;
}
.aflm-student-1 { animation-delay: 0s; }
.aflm-student-2 { animation-delay: -2s; }
.aflm-student-3 { animation-delay: -4s; }

@keyframes aflmWalk {
  0%   { transform: translate(20px, 140px) scale(1); opacity: 0; }
  10%  { opacity: 1; }
  60%  { transform: translate(160px, 140px) scale(1); opacity: 1; }
  75%  { transform: translate(170px, 140px) scale(0.92); opacity: 0.5; }
  85%  { transform: translate(170px, 140px) scale(0); opacity: 0; }
  100% { transform: translate(20px, 140px) scale(0); opacity: 0; }
}
.aflm-student g, .aflm-student use {
  animation: aflmBob 0.45s ease-in-out infinite alternate;
}
@keyframes aflmBob {
  from { transform: translateY(0); }
  to   { transform: translateY(-2px); }
}

@media (max-width: 600px) {
  .atena-forum-link-modal { padding: 0; align-items: stretch; }
  .aflm-card {
    max-width: none; max-height: 100vh; height: 100vh;
    border-radius: 0;
  }
  .aflm-head { padding: max(env(safe-area-inset-top), 18px) 20px 0; }
  .aflm-body { padding: 8px 22px 20px; }
  .aflm-title { font-size: 21px; }
  .aflm-loading-screen { padding: 24px 20px 20px; }
  .aflm-school-scene { height: 160px; }
}