* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #0e1116;
  color: #e8eaed;
}

/* ---------- Login page ---------- */
.login-body {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #1a2130 0%, #0e1116 70%);
}

.login-card {
  background: #161b24;
  border: 1px solid #262c3a;
  border-radius: 14px;
  padding: 40px 36px;
  width: 340px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.logo-mark {
  background: linear-gradient(135deg, #d4a017, #b8860b);
  color: #0e1116;
  font-weight: 800;
  font-size: 14px;
  padding: 6px 9px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

.logo-mark.small { padding: 5px 8px; font-size: 12px; }

.logo-text {
  font-size: 19px;
  font-weight: 400;
  color: #e8eaed;
}
.logo-text strong { font-weight: 800; color: #d4a017; }

.login-sub {
  font-size: 12.5px;
  color: #8a93a3;
  margin-bottom: 28px;
}

.login-form { display: flex; flex-direction: column; text-align: left; }

.login-form label {
  font-size: 12px;
  color: #a0a8b8;
  margin-bottom: 6px;
  margin-top: 14px;
}

.login-form input {
  background: #0e1116;
  border: 1px solid #2a3140;
  border-radius: 8px;
  padding: 11px 12px;
  color: #e8eaed;
  font-size: 14px;
  outline: none;
}
.login-form input:focus { border-color: #d4a017; }

.login-btn {
  margin-top: 24px;
  background: #d4a017;
  color: #0e1116;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s;
}
.login-btn:hover { filter: brightness(1.08); }

.login-note {
  margin-top: 20px;
  font-size: 11px;
  color: #5c6473;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: #12161f;
  border-bottom: 1px solid #232a37;
}

.topbar-left { display: flex; align-items: center; gap: 9px; }

.topbar-right { display: flex; align-items: center; gap: 14px; }

.balance-pill {
  background: #1a2130;
  border: 1px solid #2a3140;
  border-radius: 20px;
  padding: 7px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
}
.balance-label { font-size: 9.5px; color: #7c8494; text-transform: uppercase; letter-spacing: 0.5px; }
.balance-amount { font-size: 13.5px; font-weight: 700; color: #3ddc84; }

.lang-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #1a2130;
  border: 1px solid #2a3140;
  border-radius: 20px;
  padding: 6px 12px;
  cursor: default;
}

.flag-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #3a4150;
}
.flag-band { flex: 1; }
.flag-band.black { background: #000; }
.flag-band.red { background: #dd0000; }
.flag-band.gold { background: #ffce00; }

.lang-code { font-size: 12px; font-weight: 700; color: #cfd4dd; }

/* ---------- Welcome / summary ---------- */
.welcome-area { padding: 32px 28px 8px; }
.welcome-area h1 { font-size: 24px; font-weight: 700; }
.welcome-sub { font-size: 13px; color: #8a93a3; margin-top: 4px; }

.market-summary {
  display: flex;
  gap: 14px;
  padding: 20px 28px 8px;
  flex-wrap: wrap;
}

.index-card {
  background: #161b24;
  border: 1px solid #232a37;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}
.index-name { font-size: 11.5px; color: #8a93a3; }
.index-value { font-size: 16px; font-weight: 700; }
.index-change { font-size: 12px; font-weight: 700; width: fit-content; }
.index-change.up { color: #3ddc84; }
.index-change.down { color: #ff5c5c; }

/* ---------- Product footer ---------- */
.product-footer { padding: 30px 28px 50px; }

.section-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: #e8eaed; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

@media (max-width: 1200px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

.product-card {
  background: #161b24;
  border: 1px solid #232a37;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-thumb {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  background: #1a2130;
  border-radius: 8px;
  overflow: hidden;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-name { font-size: 13.5px; font-weight: 600; }

.product-qty { font-size: 11px; color: #8a93a3; }
.product-qty span {
  background: #1a2130;
  border: 1px solid #2a3140;
  border-radius: 12px;
  padding: 2px 9px;
  font-weight: 600;
  color: #cfd4dd;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.product-price { font-size: 15px; font-weight: 700; color: #e8eaed; }

.profit-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  border: 2px solid;
}
.profit-badge.pos { color: #3ddc84; border-color: #3ddc84; background: rgba(61,220,132,0.08); }
.profit-badge.neg { color: #ff5c5c; border-color: #ff5c5c; background: rgba(255,92,92,0.08); }

.buy-btn {
  margin-top: 6px;
  background: #d4a017;
  color: #0e1116;
  border: none;
  border-radius: 7px;
  padding: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s;
}
.buy-btn:hover { filter: brightness(1.08); }

/* ---------- Popup ---------- */
.market-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.market-popup.hidden { display: none; }

.market-popup-box {
  background: #1a1216;
  border: 2px solid #ff3b3b;
  border-radius: 12px;
  padding: 28px 34px;
  text-align: center;
  box-shadow: 0 0 30px rgba(255,59,59,0.25);
  max-width: 300px;
}

.popup-icon { font-size: 30px; margin-bottom: 10px; }
.popup-text { font-size: 15px; font-weight: 700; color: #ff8080; margin-bottom: 18px; }

.popup-close {
  background: #ff3b3b;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 8px 22px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.popup-close:hover { filter: brightness(1.1); }

.chart-card{
    background:#1A1E27;
    border:1px solid #2A2F3A;
    border-radius:18px;
    padding:14px;
    width:100%;
    max-width:350px;
    margin:auto;
}

.chart-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:15px;
}

.chart-header h3{
    color:#fff;
    margin:0;
    font-size:22px;
}

.chart-header span{
    color: #3ddc84;
    font-size:20px;
    font-weight:bold;
}

.chart{
    width:100%;
    height:140px;
}
.footer{
    margin-top:40px;
    padding:30px 24px;
    background:#1A1E27;
    border-top:1px solid #2B3140;
    color:#A8B0BF;
}

.footer-logo{
    display:flex;
    align-items:center;
    gap:12px;
    font-size:24px;
    font-weight:700;
    color:#fff;
    margin-bottom:18px;
}

.logo-box{
    width:42px;
    height:42px;
    border-radius:12px;
    background:#E0A800;
    color:#111;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:700;
}

.footer-text{
    color:#8E97A8;
    line-height:1.7;
    margin-bottom:25px;
}

.footer-info{
    display:grid;
    gap:16px;
}

.footer-info span{
    display:block;
    color:#70798C;
    font-size:13px;
    margin-bottom:4px;
}

.footer-info strong{
    color:#E8EDF7;
    font-size:15px;
    font-weight:500;
}

.footer-bottom{
    margin-top:28px;
    padding-top:18px;
    border-top:1px solid #2B3140;
    text-align:center;
    color:#70798C;
    font-size:13px;
}