/* ── Auth modal ───────────────────────────────────────────────────── */
.modal-bg {
  position:fixed; inset:0; z-index:600;
  background:rgba(4,13,26,0.7);
  display:flex; align-items:center; justify-content:center; padding:20px;
  opacity:0; pointer-events:none; transition:opacity 0.2s;
}
.modal-bg.on { opacity:1; pointer-events:all; }
.modal {
  background:var(--cream); border-radius:12px; padding:32px 28px;
  width:100%; max-width:400px; position:relative;
  transform:translateY(12px) scale(0.98); transition:transform 0.2s;
  max-height:90vh; overflow-y:auto; border:1px solid var(--border);
}
.modal-bg.on .modal { transform:translateY(0) scale(1); }
.modal-x { position:absolute; top:14px; right:14px; background:transparent; border:none; color:var(--muted); font-size:1rem; cursor:pointer; width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center; transition:background 0.15s; }
.modal-x:hover { background:rgba(0,0,0,0.06); }
.modal h2 { font-family:var(--font-display); font-size:1.35rem; font-weight:600; color:var(--dark); margin-bottom:4px; }
.modal-sub { font-size:0.8rem; color:var(--muted); margin-bottom:22px; }

/* Confirm box */
.confirm-box { display:none; text-align:center; padding:10px 0; }
.confirm-box.on { display:block; }
.ci { font-size:2.5rem; display:block; margin-bottom:12px; }
.confirm-box h3 { font-family:var(--font-display); font-size:1.1rem; font-weight:600; color:var(--dark); margin-bottom:8px; }
.confirm-box .confirm-email-sent { font-size:0.88rem; color:var(--text); margin-bottom:16px; line-height:1.6; }
.confirm-box .confirm-email-sent strong { color:var(--blue); }
.confirm-hint { font-size:0.75rem; color:var(--muted); background:var(--warm-bg); border-radius:8px; padding:12px 14px; text-align:left; line-height:1.7; margin-bottom:12px; }
.confirm-alt { font-size:0.74rem; color:var(--muted); background:var(--blue-pale); border:1px solid var(--border); border-radius:8px; padding:11px 14px; text-align:left; line-height:1.7; }
.confirm-alt a { color:var(--blue); font-weight:600; text-decoration:none; cursor:pointer; }
.confirm-alt a:hover { text-decoration:underline; }

/* Tabs */
.tabs { display:flex; gap:4px; margin-bottom:20px; background:var(--warm-bg); border-radius:8px; padding:4px; }
.tab { flex:1; background:transparent; border:none; font-family:var(--font-body); font-size:0.8rem; font-weight:500; color:var(--muted); padding:7px; border-radius:5px; cursor:pointer; transition:all 0.15s; }
.tab.active { background:#fff; color:var(--dark); box-shadow:0 1px 4px rgba(0,0,0,0.08); }

/* Google button */
.btn-google { width:100%; background:#fff; border:1px solid var(--border); border-radius:8px; padding:10px 16px; cursor:pointer; font-family:var(--font-body); font-size:0.85rem; font-weight:400; color:var(--text); display:flex; align-items:center; justify-content:center; gap:10px; transition:border-color 0.15s, box-shadow 0.15s; margin-bottom:14px; }
.btn-google:hover { border-color:#aaa; box-shadow:0 1px 6px rgba(0,0,0,0.08); }

/* Divider */
.auth-divider { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.auth-divider::before, .auth-divider::after { content:''; flex:1; height:1px; background:var(--border); }
.auth-divider-text { font-size:0.72rem; color:var(--muted); white-space:nowrap; }

/* Fields */
.field { margin-bottom:12px; }
.field label { display:block; font-size:0.72rem; font-weight:600; color:var(--muted); margin-bottom:4px; letter-spacing:0.04em; text-transform:uppercase; }
.field input { width:100%; background:#fff; border:1px solid var(--border); border-radius:7px; padding:10px 12px; font-family:var(--font-body); font-size:0.88rem; color:var(--text); outline:none; transition:border-color 0.15s; }
.field input:focus { border-color:var(--blue); }
.btn-auth { width:100%; background:var(--blue); color:#fff; border:none; border-radius:7px; font-family:var(--font-body); font-size:0.88rem; font-weight:600; padding:12px; cursor:pointer; margin-top:6px; transition:background 0.15s; }
.btn-auth:hover { background:var(--blue-mid); }
.btn-auth:disabled { opacity:0.55; cursor:not-allowed; }
.forgot { text-align:center; margin-top:10px; }
.forgot a { font-size:0.75rem; color:var(--muted); text-decoration:underline; text-underline-offset:3px; }
.forgot a:hover { color:var(--text); }
.err { font-size:0.75rem; color:#b53030; background:rgba(181,48,48,0.07); border-radius:6px; padding:8px 10px; margin-bottom:10px; display:none; }
.err.on { display:block; }
.ok-msg { font-size:0.75rem; color:var(--green); background:var(--green-pale); border-radius:6px; padding:8px 10px; margin-top:8px; display:none; }
.ok-msg.on { display:block; }

/* ── TOP-UP OVERLAY (redesigned) ─────────────────────────────────────── */
#topup-backdrop {
  position:fixed; inset:0; z-index:500;
  background:rgba(4,13,26,0.55); backdrop-filter:blur(4px);
  opacity:0; pointer-events:none; transition:opacity 0.2s;
}
#topup-overlay {
  position:fixed; right:0; top:var(--nav-h); bottom:0; z-index:501;
  width:100%; max-width:360px;
  background:var(--cream); border-left:1px solid var(--border);
  display:flex; flex-direction:column;
  padding:20px 20px 24px;
  transform:translateX(100%); transition:transform 0.25s cubic-bezier(0.4,0,0.2,1);
  overflow-y:auto;
}
#topup-backdrop.visible, #topup-overlay.visible {
  opacity:1; pointer-events:all;
}
#topup-overlay.visible { transform:translateX(0); }
@media(max-width:480px){
  #topup-overlay { max-width:100%; }
}
.topup-header { margin-bottom:20px; }
.topup-title {
  font-family:var(--font-display); font-size:1.25rem; font-weight:600;
  color:var(--dark); margin-bottom:3px;
}
.topup-subtitle { font-size:0.76rem; color:var(--muted); }
.topup-packs {
  display:grid; grid-template-columns:1fr 1fr;
  gap:8px; margin-bottom:20px;
}
.topup-pack {
  background:#fff; border:1.5px solid var(--border); border-radius:10px;
  padding:14px 12px; text-align:center; position:relative;
  transition:border-color 0.15s;
}
.topup-pack.best {
  border-color:var(--blue); background:var(--blue-pale);
}
.topup-pack:hover { border-color:var(--blue-mid); }
.topup-badge {
  font-size:0.56rem; font-weight:700; letter-spacing:0.08em; text-transform:uppercase;
  color:#fff; background:var(--blue); border-radius:4px;
  padding:2px 7px; display:inline-block; margin-bottom:6px;
  min-height:18px; line-height:14px;
}
.topup-pack:not(.best) .topup-badge { opacity:0; }
.topup-price {
  font-family:var(--font-display); font-size:1.3rem; font-weight:600;
  color:var(--dark); line-height:1; margin-bottom:2px;
}
.topup-creds {
  font-size:0.78rem; font-weight:600; color:var(--blue); margin-bottom:2px;
}
.topup-note {
  font-size:0.66rem; color:var(--muted); margin-bottom:10px;
}
.topup-buy {
  width:100%; background:var(--blue); color:#fff; border:none; border-radius:7px;
  font-family:var(--font-body); font-size:0.8rem; font-weight:600;
  padding:8px 0; cursor:pointer; transition:background 0.15s;
}
.topup-buy:hover { background:var(--blue-mid); }
.topup-buy:disabled { opacity:0.5; cursor:not-allowed; }
/* Divider with text */
.topup-divider {
  display:flex; align-items:center; gap:10px;
  margin-bottom:16px;
}
.topup-divider::before, .topup-divider::after {
  content:''; flex:1; height:1px; background:var(--border);
}
.topup-divider span {
  font-size:0.7rem; font-weight:500; color:var(--muted);
  white-space:nowrap;
}
/* Coupon section — always visible, not collapsible */
.coupon-section {
  background:var(--warm-bg); border:1px solid var(--border);
  border-radius:10px; padding:14px;
  margin-bottom:16px;
}
.coupon-row {
  display:flex; gap:8px; margin-bottom:8px;
}
.coupon-input {
  flex:1; background:#fff; border:1px solid var(--border); border-radius:7px;
  padding:9px 12px; font-family:var(--font-body); font-size:0.85rem;
  color:var(--text); outline:none; transition:border-color 0.15s;
  text-transform:uppercase;
}
.coupon-input:focus { border-color:var(--blue); }
.coupon-input:disabled { background:var(--warm-bg); color:var(--muted); }
.coupon-btn {
  background:var(--blue); color:#fff; border:none; border-radius:7px;
  font-family:var(--font-body); font-size:0.82rem; font-weight:600;
  padding:9px 16px; cursor:pointer; transition:background 0.15s; white-space:nowrap;
}
.coupon-btn:hover { background:var(--blue-mid); }
.coupon-btn:disabled { opacity:0.5; cursor:not-allowed; }
.coupon-msg {
  font-size:0.76rem; line-height:1.5; min-height:16px;
}
.coupon-msg.ok { color:var(--green); }
.coupon-msg.err { color:#b53030; }
.coupon-msg.warn { color:var(--gold,#F9A825); }
.coupon-hint {
  font-size:0.68rem; color:var(--muted); line-height:1.55;
  margin-top:8px; padding-top:8px;
  border-top:1px solid var(--border);
}
.topup-footer {
  font-size:0.7rem; color:var(--muted); line-height:1.6;
  text-align:center; margin-top:auto; padding-top:12px;
  border-top:1px solid var(--border);
}
/* Kept for backward compat with topup.js */
.coupon-toggle { display:none; }
