/* telebirr 积分 H5 —— 单文件样式，移动端优先 */
:root {
  /* telebirr 品牌配色：黄绿（取自官方色块 #94c84a） */
  --brand: #94c84a;
  --brand-dark: #6a9927;
  --brand-deep: #4d7314;
  --brand-light: #b6da85;
  --brand-soft: #f0f7e2;

  --bg: #f6faf0;
  --card: #ffffff;
  --card-2: #fbfdf7;
  --line: #e3eecf;
  --text: #17250a;
  --dim: #6f8158;
  --ink: #24350c;
  --ok: #3d9a4e;
  --err: #e5484d;
  --bronze: #c98b4b;
  --silver: #9aa7b8;
  --gold: #f0b429;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --sh-1: 0 1px 2px rgba(60, 90, 20, .05), 0 4px 14px rgba(60, 90, 20, .06);
  --sh-2: 0 6px 22px rgba(60, 90, 20, .10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 50% -8%, #e8f5d3 0%, rgba(232, 245, 211, 0) 62%),
    linear-gradient(180deg, #f8fcf3 0%, #f4f9ee 55%, #eff6e6 100%);
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 520px; margin: 0 auto; padding: 16px 16px 44px; }

.view { display: none; }
.view.active { display: block; animation: fadeUp .32s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ================= 登录 ================= */
.login-hero { text-align: center; padding: 12vh 0 26px; }
.brand-mark {
  width: 82px; height: 82px; margin: 0 auto 18px;
  border-radius: 26px;
  background: linear-gradient(145deg, var(--brand-light), var(--brand));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 30px rgba(106, 153, 39, .30), inset 0 -3px 0 rgba(0, 0, 0, .06);
}
h1 { font-size: 27px; margin: 0 0 8px; letter-spacing: -.4px; font-weight: 800; }
h2 { font-size: 17px; margin: 0; font-weight: 700; }
.sub { color: var(--dim); margin: 0; font-size: 14px; }

.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--sh-2);
}
.field-label {
  display: block; font-size: 12.5px; color: var(--dim);
  margin-bottom: 8px; font-weight: 600; letter-spacing: .3px;
}
.input-wrap {
  display: flex; align-items: center;
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 0 14px;
  margin-bottom: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.input-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(148, 200, 74, .16);
  background: #fff;
}
.input-wrap .prefix {
  color: var(--brand-deep); font-weight: 700; font-size: 15px;
  padding-right: 10px; margin-right: 10px;
  border-right: 1px solid var(--line);
}
.input-wrap input {
  flex: 1; border: 0; outline: none; background: transparent;
  padding: 15px 0; font-size: 17px; color: var(--text); letter-spacing: .5px;
}
.input-wrap input::placeholder { color: #b4c2a0; letter-spacing: .5px; }

.btn {
  width: 100%; padding: 15px; border: 0; border-radius: var(--r-md);
  font-size: 16.5px; font-weight: 700; cursor: pointer;
  transition: transform .1s ease, box-shadow .2s, opacity .2s;
  font-family: inherit;
}
.btn:active { transform: scale(.982); }
.btn.primary {
  background: linear-gradient(135deg, var(--brand) 0%, #a8d465 55%, var(--brand) 100%);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(106, 153, 39, .26);
}
.btn.primary:active { box-shadow: 0 3px 10px rgba(106, 153, 39, .3); }
.btn.lg { padding: 16px; letter-spacing: 3px; font-size: 17px; }
.btn.ghost {
  background: #fff; color: var(--brand-deep);
  border: 1.5px solid var(--line);
}
.btn.ghost:active { background: var(--brand-soft); }
.btn.small { width: auto; padding: 8px 16px; font-size: 13.5px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.hint { color: var(--dim); font-size: 13px; margin: 12px 0 0; min-height: 18px; }
.hint.center { text-align: center; }
.tiny { color: var(--dim); font-size: 12px; margin: 6px 0 0; }

.login-foot {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px dashed var(--line);
  text-align: center; color: #9aab84; font-size: 12px;
}

/* ================= 顶栏 ================= */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding-top: 4px;
}
.who { display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(145deg, var(--brand-light), var(--brand));
  color: #fff; font-weight: 800; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 5px 12px rgba(106, 153, 39, .25);
}
.msisdn { font-size: 15.5px; font-weight: 700; letter-spacing: .3px; }
.tier-chip {
  display: inline-block; margin-top: 3px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
  color: var(--brand-deep); background: var(--brand-soft);
  padding: 2px 9px; border-radius: 20px;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 13px;
  border: 1.5px solid var(--line); background: #fff;
  color: var(--dim); font-size: 17px; cursor: pointer;
  transition: background .2s, color .2s;
}
.icon-btn:active { background: var(--brand-soft); color: var(--brand-deep); }

/* ================= 余额大卡 ================= */
.hero-card {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: 22px 22px 18px;
  background: linear-gradient(140deg, #a9d75f 0%, #94c84a 42%, #7fb336 100%);
  color: var(--ink);
  box-shadow: 0 14px 30px rgba(106, 153, 39, .28);
  margin-bottom: 14px;
}
.hero-glow {
  position: absolute; right: -46px; top: -66px;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 68%);
  pointer-events: none;
}
.hero-top { display: flex; justify-content: space-between; align-items: center; }
.hero-label { font-size: 13.5px; font-weight: 600; opacity: .82; }
.hero-mult {
  font-size: 12px; font-weight: 800;
  background: rgba(255, 255, 255, .55); color: var(--brand-deep);
  padding: 3px 10px; border-radius: 20px;
}
.hero-mult:empty { display: none; }
.hero-balance {
  font-size: 52px; font-weight: 800; line-height: 1.08;
  letter-spacing: -2px; margin: 8px 0 4px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .28);
}
.hero-bottom {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; opacity: .88;
}
.hero-bottom b { font-weight: 800; }
.hero-shortcut {
  border: 0; background: rgba(255, 255, 255, .62); color: var(--brand-deep);
  padding: 7px 13px; border-radius: 20px;
  font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.hero-shortcut:active { background: #fff; }

/* ================= 卡片 ================= */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--sh-1);
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.sub-tag { font-size: 11.5px; color: #9aab84; font-weight: 600; }
.pill {
  font-size: 12px; font-weight: 700; color: var(--brand-deep);
  background: var(--brand-soft); padding: 3px 11px; border-radius: 20px;
}

/* ================= 摇一摇 ================= */
.shake-card { text-align: center; }
.shake-stage { padding: 4px 0 2px; }
.phone {
  position: relative;
  margin: 0 auto 12px; width: 118px; height: 194px;
  border-radius: 26px; padding: 7px;
  background: linear-gradient(160deg, #ffffff, #eef6e0);
  border: 2px solid var(--brand-light);
  box-shadow: 0 10px 24px rgba(106, 153, 39, .18), inset 0 0 0 1px #fff;
  cursor: pointer; user-select: none; overflow: hidden;
  transition: transform .15s ease;
}
.phone::after {
  /* 屏幕内的一道斜向高光 */
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.65) 0%, rgba(255,255,255,0) 42%);
}
.phone.shaking { animation: shake .42s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake {
  0%, 100% { transform: rotate(0) translateX(0); }
  15% { transform: rotate(-12deg) translateX(-6px); }
  35% { transform: rotate(11deg) translateX(6px); }
  55% { transform: rotate(-8deg) translateX(-4px); }
  75% { transform: rotate(5deg) translateX(3px); }
}
.phone-inner {
  width: 100%; height: 100%; border-radius: 19px;
  background: linear-gradient(175deg, #f3faea, #e8f4d6);
  display: flex; border: 1px solid #dcebc6;
}
.screen {
  margin: auto; display: flex; flex-direction: column;
  align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--dim);
}
#shake-icon { font-size: 32px; filter: saturate(.9); }
.screen strong { color: var(--brand-deep); font-size: 14.5px; letter-spacing: 1px; }
#shake-reward {
  font-style: normal; font-size: 19px; font-weight: 800;
  color: var(--brand-deep); opacity: 0; transition: opacity .25s;
}
#shake-reward.show { opacity: 1; }

.progress {
  height: 8px; background: #eaf2dc; border-radius: 6px;
  overflow: hidden; margin: 14px 4px 0;
}
.progress-bar {
  height: 100%; width: 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--brand-light), var(--brand-dark));
  transition: width .38s cubic-bezier(.4, 0, .2, 1);
}

/* ================= 买积分（两列网格） ================= */
.pkg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pkg {
  position: relative;
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 13px;
  cursor: pointer;
  transition: border-color .18s, transform .1s, box-shadow .18s, background .18s;
}
.pkg:active { transform: scale(.98); border-color: var(--brand); background: var(--brand-soft); }
.pkg.hot { border-color: var(--brand); background: #fcfef6; }
.pkg-badge {
  position: absolute; top: -8px; right: 10px;
  font-size: 10.5px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #ff9f43, #f0762a);
  padding: 2px 9px; border-radius: 20px;
  box-shadow: 0 3px 8px rgba(240, 118, 42, .35);
}
.pkg-points {
  font-size: 22px; font-weight: 800; color: var(--text);
  letter-spacing: -.6px; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.pkg-points span { font-size: 12.5px; font-weight: 600; color: var(--dim); margin-left: 3px; }
.pkg-bonus {
  font-size: 11.5px; color: var(--brand-deep); font-weight: 700;
  margin-top: 3px; min-height: 16px;
}
.pkg-price {
  margin-top: 9px; padding-top: 9px;
  border-top: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.pkg-price b { font-size: 15.5px; color: var(--brand-deep); font-weight: 800; }
.pkg-price i {
  font-style: normal; font-size: 11.5px; font-weight: 700;
  color: var(--brand-deep); background: var(--brand-soft);
  padding: 4px 10px; border-radius: 20px;
}

/* ================= 会员 ================= */
.tiers { display: flex; flex-direction: column; gap: 10px; }
.tier-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 15px;
  transition: border-color .2s, background .2s;
}
.tier-row.current {
  border-color: var(--brand);
  background: linear-gradient(120deg, #fbfdf6, var(--brand-soft));
  box-shadow: 0 0 0 1px rgba(148, 200, 74, .35) inset;
}
.tier-left { display: flex; align-items: center; gap: 12px; }
.medal {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.medal.bronze { background: linear-gradient(145deg, #f3ddc7, #e0b98d); }
.medal.silver { background: linear-gradient(145deg, #eef1f5, #ccd4de); }
.medal.gold   { background: linear-gradient(145deg, #ffeeb3, #f5cf6b); }
.tier-name { font-size: 15.5px; font-weight: 700; }
.tier-desc { font-size: 12px; color: var(--dim); margin-top: 1px; }
.tier-right { text-align: right; }
.tier-price { font-size: 14px; font-weight: 800; color: var(--brand-deep); }
.tier-price small { font-size: 11px; font-weight: 600; color: var(--dim); }
.tier-current {
  font-size: 12px; font-weight: 800; color: var(--brand-deep);
  background: var(--brand-soft); padding: 5px 12px; border-radius: 20px;
  display: inline-block;
}

/* ================= 兑换 ================= */
.catalog { display: flex; flex-direction: column; gap: 10px; }
.item-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 15px;
  transition: border-color .18s;
}
.item-row:active { border-color: var(--brand-light); }
.item-left { display: flex; align-items: center; gap: 12px; }
.item-icon {
  width: 40px; height: 40px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
  background: var(--brand-soft);
}
.item-icon.airtime { background: #eaf4ff; }
.item-icon.data    { background: #eef0ff; }
.item-icon.coupon  { background: #fff4e2; }
.item-icon.emoney  { background: #ffeaea; }
.item-title { font-size: 15px; font-weight: 700; }
.item-type { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.item-right { text-align: right; flex-shrink: 0; margin-left: 10px; }
.item-cost { font-size: 13.5px; color: var(--brand-deep); font-weight: 800; margin-bottom: 7px; }
.item-cost small { font-size: 11px; color: var(--dim); font-weight: 600; }

.foot { text-align: center; color: #a9b89a; font-size: 11.5px; margin-top: 22px; }

/* ================= 提示 ================= */
.toast {
  position: fixed; left: 50%; bottom: 40px;
  transform: translateX(-50%) translateY(18px);
  background: rgba(36, 53, 12, .95);
  color: #f2f9e6;
  padding: 13px 22px; border-radius: 14px; font-size: 14px; font-weight: 600;
  box-shadow: 0 12px 32px rgba(20, 35, 5, .35);
  opacity: 0; pointer-events: none;
  transition: opacity .26s, transform .26s;
  max-width: 84vw; text-align: center;
  backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { box-shadow: 0 12px 32px rgba(61, 154, 78, .3), 0 0 0 1px rgba(148, 200, 74, .5); }
.toast.err { background: rgba(120, 22, 26, .96); color: #fff; }
