/* ===================================================
   TOEFL Self-Guided Course — Access gate styles
   Reuses the course's brand tokens (var(--orange), etc.)
   =================================================== */

/* Hide the course app until access is confirmed. */
body.locked .app,
body.locked .tabbar { display: none !important; }

/* The gate is hidden once the student is in. */
body:not(.locked) #authGate { display: none; }

#authGate {
  position: fixed;
  inset: 0;
  z-index: 4000;
  overflow-y: auto;
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--orange-soft) 0%, transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  font-family: var(--font-body);
  color: var(--ink);
}

.gate__wrap {
  max-width: 460px;
  margin: 0 auto;
  padding: 34px 20px 60px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.gate__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 22px;
}
.gate__brand img { width: 44px; height: 44px; border-radius: 12px; }
.gate__brand-name { font-weight: 800; font-size: 17px; }
.gate__brand-tag { color: var(--ink-3); font-size: 12.5px; font-weight: 600; }

.gate__card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 26px 24px;
}

.gate__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 25px;
  line-height: 1.15;
  margin: 0 0 6px;
}
.gate__sub { color: var(--ink-2); font-size: 14.5px; line-height: 1.5; margin: 0 0 18px; }

/* Tabs (Log in / Create account) */
.gate__tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-2);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 20px;
}
.gate__tab {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-2);
  padding: 9px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.gate__tab[aria-selected="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.gate__field { margin-bottom: 13px; }
.gate__field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.gate__field input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.gate__field input:focus {
  outline: 0;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}

.gate__btn {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-weight: 800;
  font-size: 15.5px;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .12s var(--ease), filter .15s var(--ease), background .15s var(--ease);
}
.gate__btn:active { transform: translateY(1px) scale(.995); }
.gate__btn[disabled] { opacity: .6; cursor: default; }

.gate__btn--primary {
  background: linear-gradient(180deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm), var(--inner-hi);
}
.gate__btn--primary:hover:not([disabled]) { filter: brightness(1.04); }

.gate__btn--pay {
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm), var(--inner-hi);
}

.gate__btn--google {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
}
.gate__btn--google:hover { background: var(--bg-2); }

.gate__btn--ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1.5px solid var(--line-strong);
  font-weight: 700;
}
.gate__btn--ghost:hover { background: var(--bg-2); }

.gate__or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 700;
  margin: 16px 0;
}
.gate__or::before, .gate__or::after {
  content: ""; height: 1px; background: var(--line); flex: 1;
}

.gate__link {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--blue-dark); font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.gate__link:hover { text-decoration: underline; }

.gate__foot {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-2);
}

.gate__msg {
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 16px;
}
.gate__msg--err { background: var(--red-soft); color: #B4292D; }
.gate__msg--ok  { background: var(--green-soft); color: var(--green-dark); }
.gate__msg--info{ background: var(--blue-soft); color: var(--blue-deep); }

/* Price / offer block */
.gate__price {
  text-align: center;
  margin: 4px 0 18px;
}
.gate__price-amt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
  color: var(--ink);
}
.gate__price-note { color: var(--ink-3); font-weight: 700; font-size: 13px; margin-top: 4px; }

.gate__perks { list-style: none; margin: 0 0 20px; padding: 0; }
.gate__perks li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; color: var(--ink-2); padding: 6px 0; font-weight: 600;
}
.gate__perks li::before {
  content: "✓"; color: var(--green-dark); font-weight: 900; flex: none;
}

.gate__divider-card {
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px dashed var(--line-strong);
}

/* Small spinner */
.gate__spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  animation: gate-spin .7s linear infinite;
}
.gate__spin--ink { border-color: var(--line-strong); border-top-color: var(--orange); }
@keyframes gate-spin { to { transform: rotate(360deg); } }

.gate__center { text-align: center; }
.gate__center .gate__spin { margin: 8px auto 16px; }

/* Account button injected into the course topbar */
#gateAccountBtn {
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font: inherit; font-weight: 700; font-size: 13px;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
#gateAccountBtn:hover { background: var(--bg-2); }
#gateAccountBtn .gate__avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(180deg, var(--orange), var(--orange-dark));
  color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Account sheet */
.gate__sheet-backdrop {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(20,21,39,.5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.gate__sheet {
  background: var(--card); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 420px;
  padding: 24px; font-family: var(--font-body); color: var(--ink);
}
.gate__row {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.gate__row:last-of-type { border-bottom: 0; }
.gate__row span:first-child { color: var(--ink-3); font-weight: 700; }
.gate__row span:last-child { font-weight: 700; text-align: right; }
.gate__pill {
  font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  background: var(--green-soft); color: var(--green-dark);
}

@media (max-width: 380px) {
  .gate__wrap { padding: 24px 14px 48px; }
  .gate__card { padding: 22px 18px; }
  .gate__price-amt { font-size: 38px; }
}
