/* Tích Điểm Quế Lâm 2027 — gu Vertu: xanh rừng sâu, vàng champagne, huy chương chất liệu */
:root {
  --green-950: #04170f;
  --green-900: #06231a;
  --green-800: #0b3524;
  --green-700: #114a32;
  --gold: #d4af37;
  --gold-light: #f1d98a;
  --gold-deep: #9a7b1e;
  --ink: #10231a;
  --paper: #f7f3e8;
  --card-bg: #0d2f21;
  --line: rgba(212, 175, 55, 0.35);
  --error: #ff9a8a;
  --ok: #8fe3b0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--green-950);
  color: var(--paper);
  min-height: 100vh;
}
h2, h3, h4 { margin: 0 0 12px; font-weight: 600; }
label { display: block; font-size: 13px; color: #cfe0d2; margin-bottom: 10px; }
input, select {
  width: 100%; margin-top: 5px; padding: 11px 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.07);
  color: #fff; font-size: 15px; outline: none;
}
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,0.22); }
select option { color: #111; }
button { cursor: pointer; font-family: inherit; }
.error { color: var(--error); min-height: 18px; font-size: 14px; }
.hint { color: #a9c2ae; font-size: 13px; line-height: 1.5; }
.hint.center { text-align: center; }

/* ---------- Màn hình khóa ---------- */
.lock { position: relative; overflow: hidden; }
.lock-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(900px 480px at 85% -5%, rgba(212,175,55,0.20), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(38,120,80,0.35), transparent 60%),
    radial-gradient(1000px 700px at 50% 115%, rgba(212,175,55,0.10), transparent 60%),
    linear-gradient(160deg, var(--green-900), var(--green-950) 70%);
}
.lock-inner { position: relative; max-width: 1060px; margin: 0 auto; padding: 28px 18px 40px; }
.brand { display: flex; align-items: center; gap: 16px; justify-content: center; text-align: left; }
.brand-logo { width: 74px; height: 74px; object-fit: contain; filter: drop-shadow(0 4px 14px rgba(0,0,0,0.5)); }
.brand-name { font-size: 21px; letter-spacing: 2.5px; font-weight: 700; color: var(--gold-light); }
.brand-sub { font-size: 14.5px; color: #cfe0d2; margin-top: 3px; }
.showcase-title { text-align: center; margin: 30px 0 14px; font-size: 15px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold-light); }

/* Huy chương 6 hạng — mỗi hạng một chất liệu */
.rank-showcase { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.rank-item { width: 148px; text-align: center; }
.medal {
  position: relative; width: 104px; height: 104px; margin: 0 auto 8px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,0.45), inset 0 2px 3px rgba(255,255,255,0.55), inset 0 -8px 14px rgba(0,0,0,0.35);
}
.medal svg { width: 56px; height: 56px; position: relative; z-index: 2; }
.medal::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.55) 46%, rgba(255,255,255,0.08) 54%, transparent 68%);
}
.medal::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.5); box-shadow: inset 0 0 0 3px rgba(0,0,0,0.10);
}
.medal.thanh-vien { background: radial-gradient(circle at 32% 28%, #3a3a42, #101014 62%, #050507); color: var(--gold-light); }
.medal.dong { background: radial-gradient(circle at 32% 28%, #e0aa68, #a66a2e 55%, #6e421a); color: #fff7e8; }
.medal.bac { background: radial-gradient(circle at 32% 28%, #ffffff, #c3ccd4 52%, #828e99); color: #40506b; }
.medal.vang { background: radial-gradient(circle at 32% 28%, #ffedb0, #e3b83c 52%, #96700f); color: #5c4303; }
.medal.bach-kim { background: radial-gradient(circle at 32% 28%, #ffffff, #dfe7ec 45%, #93a3ae 80%, #c9d4db); color: #31435c; }
.medal.kim-cuong {
  background:
    repeating-linear-gradient(48deg, rgba(255,255,255,0.20) 0 7px, transparent 7px 14px),
    repeating-linear-gradient(-52deg, rgba(255,255,255,0.14) 0 6px, transparent 6px 13px),
    radial-gradient(circle at 32% 28%, #ffffff, #bcd2ea 50%, #6f87a8);
  color: #274a77;
}
.rank-name { font-size: 14px; font-weight: 600; color: #fdf6dd; }
.rank-min { font-size: 12px; color: #a9c2ae; }

/* Hộp đăng nhập + panel */
.login-card, .panel {
  background: linear-gradient(170deg, rgba(17,74,50,0.88), rgba(6,35,26,0.94));
  border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; margin: 22px auto 0; max-width: 520px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.4);
}
.lock-panels .panel { max-width: none; }
.lock-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 4px; }
@media (max-width: 820px) { .lock-panels { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line);
  background: transparent; color: #cfe0d2; font-size: 14.5px;
}
.tab.active { background: linear-gradient(160deg, var(--gold-light), var(--gold)); color: #33270a; font-weight: 700; border-color: transparent; }
.btn-gold {
  width: 100%; padding: 13px; border: none; border-radius: 11px; font-size: 15.5px; font-weight: 700;
  color: #33270a; background: linear-gradient(160deg, var(--gold-light), var(--gold) 60%, var(--gold-deep));
  box-shadow: 0 8px 20px rgba(212,175,55,0.35);
}
.btn-gold.small { width: auto; padding: 10px 20px; font-size: 14.5px; }
.btn-ghost {
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: transparent; color: var(--gold-light); font-size: 14px;
}
.calc-grid, .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .calc-grid, .form-grid { grid-template-columns: 1fr; } }
.calc-result { margin-top: 8px; font-size: 15px; line-height: 1.7; color: #fdf6dd; }
.calc-result b { color: var(--gold-light); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 8px 9px; border-bottom: 1px solid rgba(255,255,255,0.09); text-align: right; white-space: nowrap; }
th { color: var(--gold-light); font-weight: 600; }
td.l, th.l { text-align: left; }
tr.current-tier td { background: rgba(212,175,55,0.14); font-weight: 700; }
.rules { line-height: 1.65; padding-left: 18px; margin: 0; color: #dceadd; font-size: 14px; }
.lock-foot { text-align: center; color: #87a58c; font-size: 12.5px; margin-top: 26px; }

/* ---------- Khung app sau đăng nhập ---------- */
.app-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  background: linear-gradient(170deg, var(--green-800), var(--green-900));
  position: sticky; top: 0; z-index: 20;
}
.app-head-left { display: flex; align-items: center; gap: 12px; }
.head-logo { width: 46px; height: 46px; object-fit: contain; }
.head-title { font-weight: 700; color: var(--gold-light); font-size: 16.5px; }
.head-sub { font-size: 13px; color: #cfe0d2; }
.container { max-width: 1060px; margin: 0 auto; padding: 20px 16px 44px; }
.container .panel { max-width: none; margin-top: 18px; }

/* Thẻ thành viên Vertu */
.member-card {
  position: relative; border-radius: 22px; padding: 26px 28px; overflow: hidden;
  min-height: 230px; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 24px 50px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.6), inset 0 -14px 28px rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.35);
}
.member-card::before {
  content: ""; position: absolute; inset: 10px; border-radius: 15px; pointer-events: none;
  border: 1.5px solid rgba(212,175,55,0.65); box-shadow: inset 0 0 0 4px rgba(0,0,0,0.08), inset 0 0 22px rgba(212,175,55,0.18);
}
.member-card .sheen {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(112deg, transparent 26%, rgba(255,255,255,0.5) 44%, rgba(255,255,255,0.06) 55%, transparent 70%);
}
.member-card .sweep {
  position: absolute; top: -20%; bottom: -20%; width: 34%; left: -45%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-14deg); animation: sweep 6.5s ease-in-out infinite;
}
@keyframes sweep { 0%, 55% { left: -45%; } 88%, 100% { left: 118%; } }
.member-card.thanh-vien { background: radial-gradient(120% 150% at 18% 0%, #33333d, #101014 58%, #060608); color: #f3e9c8; }
.member-card.dong { background: radial-gradient(120% 150% at 18% 0%, #e7b878, #a66a2e 58%, #6e421a); color: #fff7e8; }
.member-card.bac { background: radial-gradient(120% 150% at 18% 0%, #ffffff, #c3ccd4 55%, #7e8b96); color: #26374d; }
.member-card.vang { background: radial-gradient(120% 150% at 18% 0%, #ffedb0, #e3b83c 55%, #8f6a0c); color: #4a3603; }
.member-card.bach-kim { background: radial-gradient(120% 150% at 18% 0%, #ffffff, #dfe7ec 48%, #8fa1ad 82%, #c9d4db); color: #22374f; }
.member-card.kim-cuong {
  background:
    repeating-linear-gradient(48deg, rgba(255,255,255,0.16) 0 9px, transparent 9px 18px),
    repeating-linear-gradient(-52deg, rgba(255,255,255,0.10) 0 8px, transparent 8px 16px),
    radial-gradient(120% 150% at 18% 0%, #ffffff, #bcd2ea 52%, #647e9f);
  color: #1d3a5f;
}
.mc-top { display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 2; }
.mc-brand { font-size: 12.5px; letter-spacing: 2.6px; font-weight: 700; opacity: 0.9; }
.mc-rank { text-align: right; }
.mc-rank .medal { width: 74px; height: 74px; margin: 0; }
.mc-rank .medal svg { width: 40px; height: 40px; }
.mc-rank-name { font-size: 14px; font-weight: 700; margin-top: 5px; letter-spacing: 1px; }
.mc-points { position: relative; z-index: 2; margin-top: 8px; }
.mc-points .num {
  font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: 1px;
  background: linear-gradient(100deg, #fff8dc 15%, var(--gold) 38%, #fff3c4 55%, var(--gold-deep) 78%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine-text 5s linear infinite; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.35));
}
.member-card.bac .mc-points .num, .member-card.bach-kim .mc-points .num, .member-card.kim-cuong .mc-points .num {
  background: linear-gradient(100deg, #ffffff 15%, #b9c8d6 40%, #ffffff 58%, #7e93a6 80%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text;
}
@keyframes shine-text { 0% { background-position: 0% 0; } 100% { background-position: 220% 0; } }
.mc-points .lbl { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; opacity: 0.85; }
.mc-bottom { display: flex; justify-content: space-between; gap: 10px; position: relative; z-index: 2; font-size: 14px; margin-top: 14px; flex-wrap: wrap; }
.mc-bottom .who b { display: block; font-size: 16.5px; }

/* Thống kê + kỳ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 18px; }
.stat {
  background: linear-gradient(170deg, rgba(17,74,50,0.88), rgba(6,35,26,0.94));
  border: 1px solid var(--line); border-radius: 15px; padding: 15px 17px;
}
.stat .v { font-size: 23px; font-weight: 800; color: var(--gold-light); }
.stat .k { font-size: 12.5px; color: #a9c2ae; margin-top: 3px; letter-spacing: 0.4px; }
.progress-outer { height: 14px; border-radius: 8px; background: rgba(255,255,255,0.10); overflow: hidden; border: 1px solid rgba(255,255,255,0.12); }
.progress-inner { height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-light)); border-radius: 8px; transition: width 0.6s ease; }
.period-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.period-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: rgba(255,255,255,0.04); }
.period-card .p-name { color: var(--gold-light); font-weight: 700; }
.period-card .p-points { font-size: 21px; font-weight: 800; margin: 4px 0; }
.period-card .p-sub { font-size: 12.5px; color: #a9c2ae; }
.issued {
  margin-top: 12px; padding: 14px 16px; border-radius: 12px;
  border: 1px dashed var(--gold); background: rgba(212,175,55,0.10); font-size: 15px; line-height: 1.7;
}
.issued b { color: var(--gold-light); }
.row-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
td .mini { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; border: 1px solid var(--line); background: transparent; color: var(--gold-light); margin-right: 5px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; border: 1px solid var(--line); color: var(--gold-light); }
.badge.off { color: #c9c9c9; border-color: rgba(255,255,255,0.2); }

/* Modal + toast */
.modal { position: fixed; inset: 0; background: rgba(2,10,6,0.78); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-card { width: 100%; max-width: 430px; background: linear-gradient(170deg, var(--green-800), var(--green-900)); border: 1px solid var(--gold); border-radius: 18px; padding: 24px; }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60;
  background: #0d2f21; border: 1px solid var(--gold); color: #fdf6dd; padding: 11px 18px;
  border-radius: 12px; font-size: 14.5px; box-shadow: 0 12px 30px rgba(0,0,0,0.5); max-width: 92vw; text-align: center;
}
