/* login.css — the account button in the header and the phone+OTP window.
   Kept separate from style.css so the original stylesheet is never touched. */

/* ---- header account area ---- */
.acct { position: relative; display: flex; align-items: center; }
.acct__in { position: relative; }
.acct__chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--field); color: var(--ink);
  font: inherit; font-size: 0.86rem; cursor: pointer;
}
.acct__chip:hover { border-color: var(--g2); }
.acct__dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #04122b; font-weight: 700; font-size: 0.85rem;
}
.acct__name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct__bal { font-weight: 700; color: var(--g3); }

.acct__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 45;
  display: flex; flex-direction: column; min-width: 180px; padding: 6px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--card, #fff); box-shadow: var(--shadow);
}
.acct__menu button {
  text-align: left; padding: 9px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink); font: inherit; font-size: 0.86rem; cursor: pointer;
}
.acct__menu button:hover { background: color-mix(in srgb, var(--g2) 14%, transparent); }

@media (max-width: 720px) { .acct__name { display: none; } }

/* ---- login window ---- */
.login-card { width: min(420px, 96vw); }
.login-step { display: flex; flex-direction: column; }
.login-label { margin: 6px 0 6px; font-size: 0.82rem; font-weight: 600; }
.login-phone { display: flex; align-items: stretch; gap: 8px; }
.login-cc {
  display: grid; place-items: center; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--field); font-size: 0.92rem;
}
.login-otp { letter-spacing: 0.5em; text-align: center; font-size: 1.2rem; }
.login-go { margin-top: 16px; justify-content: center; }
.login-hint { margin: 12px 0 0; font-size: 0.84rem; text-align: center; }
.login-link {
  border: 0; background: none; padding: 0; font: inherit; font-size: inherit;
  color: var(--g3); text-decoration: underline; cursor: pointer;
}
.login-err {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 0.85rem;
  background: color-mix(in srgb, #ef4444 14%, transparent); color: #b91c1c;
}
.login-foot { margin: 16px 0 0; font-size: 0.75rem; color: var(--ink-muted); text-align: center; }

/* ---- cost confirmation ---- */
.cost-table { width: 100%; border-collapse: collapse; margin: 14px 0 4px; font-size: 0.9rem; }
.cost-table td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.cost-table td:last-child { text-align: right; font-weight: 600; }
.cost-table tr:last-child td { border-bottom: 0; }
.cost-table .cost-big td { font-size: 1.05rem; }
.cost-short td { color: #b91c1c; }
.cost-actions { display: flex; gap: 10px; margin-top: 16px; }
.cost-actions .btn { flex: 1; justify-content: center; }

.login-opt { font-weight: 400; color: var(--ink-muted); font-size: 0.78rem; }

/* ---- my account (statement) ---- */
.acct-card { max-width: 560px; }
.acct-bal { font-size: 1.6rem; font-weight: 700; margin: 6px 0 2px; }
.acct-low {
  margin: 8px 0 0; padding: 9px 12px; border-radius: 10px;
  background: #fff4e5; color: #8a5a00; font-size: 0.85rem;
}
.acct-table { width: 100%; border-collapse: collapse; margin: 14px 0 4px; font-size: 0.85rem; }
.acct-table td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.acct-table td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.acct-table tr:last-child td { border-bottom: 0; }
.acct-when { color: var(--ink-muted); font-size: 0.76rem; display: block; }
.acct-minus { color: #b91c1c; }
.acct-plus  { color: #067647; }
.acct-empty { color: var(--ink-muted); font-size: 0.85rem; margin: 16px 0; }
.acct-del { margin-top: 16px; width: 100%; justify-content: center; color: #b91c1c; }

/* Header chip turns amber when the balance is low. */
.acct__in.is-low { background: #fff4e5; border-color: #f0b429; }

/* ---- waiting for the SMS (no Resend button until the wait is over) ---- */
.login-wait {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 10px;
  font-size: 0.84rem; line-height: 1.5; text-align: center;
  background: color-mix(in srgb, var(--g2) 10%, transparent); color: var(--ink);
}
.login-dots { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.login-dots i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--g3);
  animation: loginBlink 1.2s infinite ease-in-out;
}
.login-dots i:nth-child(2) { animation-delay: 0.2s; }
.login-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes loginBlink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* "Your earlier OTP still works" — asked before a paid resend. */
.login-ask {
  margin: 12px 0 0; padding: 12px; border-radius: 10px; font-size: 0.84rem;
  border: 1px solid var(--line); background: var(--field); text-align: center;
}
.login-ask p { margin: 0 0 10px; line-height: 1.5; }
.login-ask__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.login-ask__btns .btn { flex: 1; justify-content: center; font-size: 0.8rem; }

/* Code is dead (5 wrong tries / expired): Resend pulses so it is noticed. */
.login-pulse { animation: loginPulse 1.4s infinite; }
@keyframes loginPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---- My account: a clear way out, and closing kept out of the way ---- */
.acct-back { margin-top: 16px; width: 100%; justify-content: center; }
.acct-del-link {
  display: block; margin: 14px auto 0; padding: 0; border: 0; background: none;
  font: inherit; font-size: 0.78rem; color: var(--ink-muted);
  text-decoration: underline; cursor: pointer;
}
.acct-del-link:hover { color: #b91c1c; }
.acct-ask {
  margin: 12px 0 0; padding: 12px; border-radius: 10px; font-size: 0.82rem; line-height: 1.5;
  border: 1px solid #f3c4c4; background: color-mix(in srgb, #ef4444 6%, transparent);
}
.acct-ask p { margin: 0 0 8px; }
.acct-ask__btns { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.acct-ask__btns .btn { justify-content: center; font-size: 0.8rem; }
.acct-ask__yes { color: #b91c1c; }

/* ---- adding money ---- */
.topup-overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  padding: 16px; background: rgba(8, 15, 35, 0.55);
}
.topup-overlay[hidden] { display: none; }
.topup-card {
  position: relative; width: min(440px, 96vw); max-height: 92vh; overflow-y: auto;
  padding: 24px 22px 18px; border-radius: 18px;
  background: var(--card, #fff); color: var(--ink); box-shadow: var(--shadow);
}
.topup-card h3 { margin: 0 0 4px; font-size: 1.25rem; }
.topup-x {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--field);
  cursor: pointer; font-size: 0.9rem; color: var(--ink);
}
.topup-bal { margin: 0 0 14px; font-size: 0.9rem; color: var(--ink-muted); }
.topup-bal b { color: var(--ink); }
.topup-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.topup-amt {
  padding: 12px 0; border-radius: 12px; border: 1px solid var(--line);
  background: var(--field); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer;
}
.topup-amt:hover { border-color: #1d4ed8; }
.topup-amt.is-on { border-color: #1d4ed8; background: #1d4ed8; color: #fff; }
.topup-own { display: block; margin: 14px 0 0; font-size: 0.85rem; font-weight: 600; }
.topup-own__row {
  display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--field); font-size: 1rem;
}
.topup-own__row input {
  flex: 1; border: 0; background: transparent; padding: 11px 0; font: inherit; color: var(--ink); outline: none;
}
.topup-hint { min-height: 1em; margin: 6px 0 0; font-size: 0.78rem; color: #b91c1c; }
.topup-go { width: 100%; justify-content: center; margin-top: 10px; }
.topup-go:disabled { opacity: 0.55; cursor: not-allowed; }
.topup-msg {
  margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 0.85rem;
  background: color-mix(in srgb, #ef4444 14%, transparent); color: #b91c1c;
}
.topup-msg.is-good { background: #e7f6ec; color: #067647; }
.topup-note { margin: 14px 0 0; font-size: 0.76rem; line-height: 1.5; color: var(--ink-muted); }
.topup-legal { margin: 8px 0 0; font-size: 0.74rem; color: var(--ink-muted); }
.topup-legal a { color: #1d4ed8; }
@media (max-width: 400px) { .topup-quick { grid-template-columns: repeat(2, 1fr); } }
