@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Roboto+Mono:wght@400;500;600;700&display=swap');

*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg:        #0d0d0f;
  --bg2:       #111114;
  --bg3:       #17171b;
  --bg4:       #1e1e23;
  --bg5:       #252529;
  --border:    #2c2c32;
  --border2:   #383840;

  --text:      #ffffff;
  --text2:     #9898a0;
  --text3:     #555560;

  --blue:      #1a82f7;
  --blue-dk:   #1567cc;
  --blue-bg:   #1a82f71a;

  --green:     #00c896;
  --green-bg:  #00c8961a;

  --red:       #f04e52;
  --red-dk:    #c93b3e;
  --red-bg:    #f04e521a;

  --gold:      #f0b429;
  --gold-bg:   #f0b4291a;

  --purple-bg: #a064fa1a;
  --purple:    #a064fa;

  --font:      'Inter', sans-serif;
  --mono:      'Roboto Mono', monospace;

  --nav-h:     62px;
  --r:         12px;
  --r2:        8px;
  --r3:        6px;
}

html, body {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 430px;
  height: var(--nav-h);
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text3);
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.3px;
  transition: color 0.15s;
  cursor: pointer;
}
.nav-item i { font-size: 17px; }
.nav-item.active { color: var(--blue); }

/* ── PAGE WRAPPER ── */
.page-wrap {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 12px);
  background: var(--bg);
}
.page-wrap.no-nav { padding-bottom: 0; }

/* ── PAGE HEADER ── */
.page-header {
  padding: 20px 20px 14px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 18px; font-weight: 700; }
.header-actions { display: flex; gap: 16px; align-items: center; }
.icon-btn {
  background: none; border: none;
  color: var(--text2); cursor: pointer;
  font-size: 15px; padding: 4px;
  display: flex; align-items: center;
}

/* ── SUB-PAGE HEADER ── */
.sub-header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.back-btn {
  background: none; border: none;
  color: var(--text); font-size: 16px;
  cursor: pointer; padding: 4px;
  display: flex; align-items: center;
}
.sub-header h2 { font-size: 15px; font-weight: 700; }

/* ── AUTH LOGO ── */
.auth-logo { text-align: center; margin-bottom: 44px; }
.logo-box {
  width: 58px; height: 58px;
  background: var(--blue);
  border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 18px; font-weight: 900;
  color: #fff; letter-spacing: -1px;
}
.logo-name { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.logo-sub  { font-size: 11px; color: var(--text2); margin-top: 4px; }

/* ── FORM CARD ── */
.form-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  width: 100%;
  margin-bottom: 16px;
}
.form-field {
  display: flex; align-items: center;
  padding: 0 14px;
  height: 46px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.form-field:last-child { border-bottom: none; }
.form-field .fi {
  color: var(--text3); font-size: 13px;
  width: 18px; text-align: center;
  margin-right: 12px; flex-shrink: 0;
}
.form-field input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: var(--font); font-size: 13px;
  height: 100%;
}
.form-field input::placeholder { color: var(--text3); }
.form-field.labeled { padding-top: 16px; height: 56px; }
.field-label {
  position: absolute; top: 7px; left: 44px;
  font-size: 10px; color: var(--blue); font-weight: 500;
}
.eye-btn {
  background: none; border: none;
  color: var(--text3); font-size: 13px;
  cursor: pointer; padding: 4px;
}

/* ── BUTTONS ── */
.btn {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; width: 100%;
  border: none; border-radius: var(--r);
  padding: 14px; cursor: pointer;
  font-family: var(--font); font-size: 13px;
  font-weight: 700; letter-spacing: 0.5px;
  transition: opacity 0.15s;
}
.btn:active { opacity: 0.85; }
.btn-blue  { background: var(--blue);   color: #fff; }
.btn-red   { background: var(--red);    color: #fff; }
.btn-green { background: var(--green);  color: #fff; }

.auth-link {
  margin-top: 22px; font-size: 14px;
  color: var(--text2); text-align: center;
}
.auth-link a { color: var(--blue); text-decoration: none; }

/* ── SECTION LABEL ── */
.sec-label {
  padding: 12px 16px 6px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1px; color: var(--text3);
  text-transform: uppercase;
}
.sec-label.blue { color: var(--blue); }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); }

/* ── SETTINGS ROW ── */
.s-row {
  display: flex; align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  transition: background 0.1s;
}
.s-row:active { background: var(--bg3); }
.s-row.no-click { cursor: default; }
.s-row.no-click:active { background: var(--bg); }
.s-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-right: 12px; flex-shrink: 0; font-size: 13px;
}
.s-icon.blue   { background: var(--blue-bg);   color: var(--blue); }
.s-icon.green  { background: var(--green-bg);   color: var(--green); }
.s-icon.red    { background: var(--red-bg);     color: var(--red); }
.s-icon.gold   { background: var(--gold-bg);    color: var(--gold); }
.s-icon.purple { background: var(--purple-bg);  color: var(--purple); }
.s-icon.gray   { background: var(--bg4);        color: var(--text2); }
.s-text { flex: 1; }
.s-label { font-size: 13px; font-weight: 500; }
.s-sub { font-size: 11px; color: var(--text2); margin-top: 2px; }
.s-right { color: var(--text3); display: flex; align-items: center; gap: 6px; }
.s-val { font-size: 12px; color: var(--text); font-family: var(--mono); }

/* ── TOGGLE ── */
.toggle {
  width: 48px; height: 26px; border-radius: 13px;
  border: none; cursor: pointer; position: relative;
  background: var(--bg5); transition: background 0.2s;
  flex-shrink: 0;
}
.toggle::after {
  content: ''; position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: left 0.2s;
}
.toggle.on { background: var(--blue); }
.toggle.on::after { left: 25px; }

/* ── TOAST ── */
#toast {
  position: fixed; top: 20px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg4); border: 1px solid var(--border2);
  border-radius: 24px; padding: 10px 22px;
  font-size: 13px; color: var(--text);
  z-index: 9999; opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap; pointer-events: none;
}
#toast.show { opacity: 1; }

/* ── STICKY BOTTOM AREA ── */
.sticky-bottom {
  position: sticky; bottom: var(--nav-h);
  padding: 14px 16px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.sticky-bottom.no-nav { bottom: 0; }

/* ── CARD ── */
.card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
}

/* ── UTILITY ── */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.green { color: var(--green); }
.red   { color: var(--red); }
.blue  { color: var(--blue); }
.mono  { font-family: var(--mono); }
.bold  { font-weight: 700; }
.muted { color: var(--text2); }
