/* Academy Magic Login — white glass modal + toast
   White glassmorphism card on a dark blurred overlay. */

/* ── Reset isolation ─────────────────────────────────────────────────────── */
.aml-overlay *,
.aml-toast * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Overlay / backdrop ──────────────────────────────────────────────────── */
.aml-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;

  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);

  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: opacity;
}
.aml-overlay--visible { opacity: 1; }

/* ── Card wrapper ─────────────────────────────────────────────────────────── */
.aml-card-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
}

/* ── Modal card — white glass ────────────────────────────────────────────── */
.aml-modal {
  position: relative;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 36px 32px 28px;

  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.04),
    0 24px 64px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);

  /* Entry transform */
  transform: translateY(18px) scale(.97);
  transition:
    transform 0.35s cubic-bezier(0.34,1.56,0.64,1),
    box-shadow 0.3s ease;
  will-change: transform;
}
.aml-overlay--visible .aml-modal {
  transform: translateY(0) scale(1);
}

/* ── Close button ────────────────────────────────────────────────────────── */
.aml-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  font-size: 17px;
  color: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: background .15s, color .15s;
  line-height: 1;
}
.aml-close:hover  { background: rgba(0, 0, 0, 0.1); color: #000; }
.aml-close:focus-visible { outline: 2px solid #3e76d3; outline-offset: 2px; }

/* ── Card inner states ───────────────────────────────────────────────────── */
.aml-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
}
.aml-state[hidden] { display: none; }

/* Logo circle — subtle purple tint */
.aml-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(62, 118, 211, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  background: rgba(62, 118, 211, 0.08);
  color: #3e76d3; /* SVG play icon inherits via currentColor */
}
.aml-logo svg { width: 20px; height: 20px; }

/* Success check circle */
.aml-check-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.aml-check-circle svg { width: 26px; height: 26px; }

.aml-modal__title {
  font-size: 21px;
  font-weight: 700;
  color: #0a0a0a;
  line-height: 1.2;
  margin-bottom: 8px;
}
.aml-modal__sub {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.5);
  line-height: 1.55;
  margin-bottom: 22px;
  max-width: 300px;
}
.aml-modal__fine {
  font-size: 11.5px;
  color: rgba(0, 0, 0, 0.35);
  margin-top: 12px;
  line-height: 1.4;
}
.aml-modal__optin {
  font-size: 10px;
  color: rgba(0, 0, 0, 0.22);
  margin-top: 3px;
  line-height: 1.3;
}

/* ── Form ────────────────────────────────────────────────────────────────── */
.aml-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* Field: label stacked above input */
.aml-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

/* Label */
.aml-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.6);
  letter-spacing: .01em;
}

.aml-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: #0a0a0a;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  outline: none;
  transition: background .2s, border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}
.aml-input::placeholder { color: rgba(0, 0, 0, 0.28); }
.aml-input:focus {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(62, 118, 211, 0.45);
  box-shadow: 0 0 0 3px rgba(62, 118, 211, 0.12);
}

/* Submit button — brand purple */
.aml-submit {
  position: relative;
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  padding: 0 20px;

  background: #3e76d3;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;

  transition: opacity .2s, transform .1s;
  -webkit-appearance: none;
  appearance: none;
}
.aml-submit:hover:not(:disabled) { background: #2e66c3; }
.aml-submit:active:not(:disabled) { transform: scale(.98); }
.aml-submit:disabled { opacity: .55; cursor: not-allowed; }
.aml-submit:focus-visible { outline: 2px solid #3e76d3; outline-offset: 3px; }

/* Shimmer sweep */
.aml-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
  translate: -100% 0;
}
.aml-submit:not(:disabled):hover::after {
  animation: aml-shimmer .7s ease forwards;
}
@keyframes aml-shimmer {
  to { translate: 100% 0; }
}

/* Arrow icon inside submit button */
.aml-submit__arrow {
  display: inline-flex;
  transition: translate .2s;
}
.aml-submit:hover:not(:disabled) .aml-submit__arrow { translate: 3px 0; }

/* Spinner (loading state) */
.aml-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: aml-spin .7s linear infinite;
}
@keyframes aml-spin { to { rotate: 360deg; } }

.aml-error {
  font-size: 12.5px;
  color: #dc2626;
  line-height: 1.4;
  text-align: left;
}
.aml-error:empty { display: none; }

/* ── Toast (bottom-right, white card) ───────────────────────────────────── */
.aml-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999999;
  width: 310px;
  max-width: calc(100vw - 40px);

  background: #ffffff;
  border: 1px solid rgba(0,0,0,.08);
  color: #111827;
  border-radius: 14px;
  padding: 16px 16px 13px;

  box-shadow:
    0 4px 6px rgba(0,0,0,.04),
    0 12px 40px rgba(0,0,0,.12);

  display: flex;
  flex-direction: column;
  gap: 11px;

  transform: translateY(calc(100% + 40px));
  opacity: 0;
  transition:
    transform 0.38s cubic-bezier(0.34,1.56,0.64,1),
    opacity   0.25s ease;
}
.aml-toast--visible { transform: translateY(0); opacity: 1; }

.aml-toast__header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.aml-toast__icon { flex-shrink: 0; margin-top: 1px; }
.aml-toast__msg  { flex: 1; font-size: 13px; line-height: 1.45; color: #374151; }
.aml-toast__dismiss {
  background: none; border: none;
  color: rgba(0,0,0,.3); font-size: 17px;
  cursor: pointer; padding: 2px 4px;
  border-radius: 5px; line-height: 1; flex-shrink: 0;
  transition: color .15s;
}
.aml-toast__dismiss:hover { color: #111827; }

.aml-toast__actions { display: flex; align-items: center; gap: 10px; }
.aml-toast__cta {
  flex: 1; padding: 8px 14px;
  background: #3e76d3; color: #fff;
  border: none; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .15s;
}
.aml-toast__cta:hover:not(:disabled) { background: #2e66c3; }
.aml-toast__cta:disabled { opacity: .6; cursor: not-allowed; }
.aml-toast__maybe {
  font-size: 11.5px; color: rgba(0,0,0,.38);
  cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px; white-space: nowrap;
  transition: color .15s;
}
.aml-toast__maybe:hover { color: rgba(0,0,0,.6); }

/* ── reCAPTCHA ───────────────────────────────────────────────────────────── */
/* Hide Google's floating badge — we show inline disclosure text instead */
.grecaptcha-badge { visibility: hidden !important; }

.aml-recaptcha-notice {
  margin-top: 10px;
  font-size: 11px;
  color: rgba(0,0,0,.38);
  text-align: center;
  line-height: 1.4;
}
.aml-recaptcha-notice a {
  color: rgba(0,0,0,.45);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.aml-recaptcha-notice a:hover { color: rgba(0,0,0,.7); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .aml-modal { padding: 28px 22px 22px; }
  .aml-modal__title { font-size: 19px; }
  .aml-toast { bottom: 16px; right: 16px; left: 16px; width: auto; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .aml-overlay, .aml-modal, .aml-toast { animation: none; transition: none; }
}
