/* SecurePass — "vault / security": warm paper neutrals + deep green/teal accent.
   Strength gauge color bands: red → orange → yellow → green.
   Mono password display. Light default; dark via prefers-color-scheme. RTL aware. */

:root {
  /* light (warm paper) */
  --bg: #f5f2ec;
  --bg-2: #ebe6db;
  --panel: #ffffff;
  --panel-2: #f1ede4;
  --line: #d8d1c1;
  --line-strong: #b8af9d;
  --ink: #1a2620;
  --ink-soft: #5a685f;
  --ink-faint: #8b958e;
  --accent: #0f766e;         /* teal-700 — security green/teal */
  --accent-deep: #0a5a54;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --accent-glow: rgba(15, 118, 110, 0.24);
  --green: #0f766e;
  --err: #c0392b;
  /* strength gauge bands */
  --st-0: #d64545;   /* red    — very weak */
  --st-1: #e07b3a;   /* orange — weak */
  --st-2: #d9a82c;   /* yellow — medium */
  --st-3: #5a9e3f;   /* green  — strong */
  --st-4: #0f766e;   /* teal   — very strong */
  --radius: 14px;
  --radius-sm: 10px;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  --display: "Inter", "Apple SD Gothic Neo", sans-serif;
}
/* ===== 3-way theme (Light/Dark/System) — base :root above = native LIGHT. Opposite (dark) WCAG-aware auto-generated (contrast-solving ink/accent vs worst-case surface). ===== */
:root[data-theme="dark"]{
  --bg: #1e1b15;
  --bg-2: #090806;
  --panel: #363636;
  --panel-2: #11100d;
  --line: rgba(255,255,255,0.12);
  --line-strong: rgba(255,255,255,0.12);
  --ink: #b5cdc1;
  --ink-soft: #96a49b;
  --ink-faint: #7a867e;
  --accent: #13978d;
  --accent-deep: #11978d;
  --accent-soft: #13978d;
  --accent-glow: rgba(0,0,0,0.40);
  --green: #13978d;
  --err: #d96356;
  --st-0: #dc5f5f;
  --st-1: #d66822;
  --st-2: #a9811e;
  --st-3: #56973c;
  --st-4: #13978d;
}












@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1614;
    --bg-2: #12201c;
    --panel: #16221e;
    --panel-2: #1c2a25;
    --line: #2b3a34;
    --line-strong: #3c4d46;
    --ink: #e6efe9;
    --ink-soft: #9fb0a8;
    --ink-faint: #6b7a73;
    --accent: #2dd4bf;        /* teal-400 for dark */
    --accent-deep: #5eead4;
    --accent-soft: rgba(45, 212, 191, 0.14);
    --accent-glow: rgba(45, 212, 191, 0.32);
    --green: #2dd4bf;
    --err: #f47067;
    --st-0: #ef5a5a;
    --st-1: #f08c4d;
    --st-2: #e3b53d;
    --st-3: #6cb85a;
    --st-4: #2dd4bf;
  }
}

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

html, body {
  background:
    radial-gradient(900px 520px at 88% -8%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 460px at -4% 108%, var(--accent-soft), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
b, h1, h2, h3 { font-weight: 700; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-soft); }

/* i18n switcher theming */
.i18n-switch {
  --i18n-switch-bg: var(--panel-2);
  --i18n-switch-border: var(--line);
  --i18n-switch-fg: var(--ink);
  --i18n-switch-active-bg: var(--accent-soft);
  --i18n-switch-active-fg: var(--accent);
  --i18n-switch-menu-bg: var(--panel);
  --i18n-switch-menu-border: var(--line);
}

/* ── topbar ─────────────────────────────────────────────── */
.topbar {
  max-width: 880px;
  margin: 0 auto;
  padding: 22px clamp(16px, 5vw, 32px) 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.logo {
  width: 44px; height: 44px; border-radius: 12px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent), var(--accent-deep));
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 8px 22px -10px var(--accent-glow);
}
.brand h1 {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: -.015em;
  line-height: 1.1;
}
.brand p { font-size: 12.5px; color: var(--ink-soft); }
.brand .accent { color: var(--accent); }

.offline-badge {
  display: none;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: .02em;
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.offline-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ── tabs ───────────────────────────────────────────────── */
.head {
  max-width: 880px;
  margin: 0 auto;
  padding: 8px clamp(16px, 5vw, 32px) 0;
}
.tabs {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: thin;
}
.tabs::-webkit-scrollbar { height: 6px; }
.tabs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.tab {
  flex: 0 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.tab:hover { color: var(--ink); border-color: var(--line-strong); }
.tab.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 4px 14px -6px var(--accent-glow);
}
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── wrap / panels ──────────────────────────────────────── */
.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 4px clamp(16px, 5vw, 32px) 40px;
}
.panel {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel.is-active { display: block; }

/* ── controls / preview two-column ──────────────────────── */
.panel-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 0;
}
.controls {
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.preview {
  padding: 18px 20px;
  min-width: 0;
}

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.lbl {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 7px;
  letter-spacing: .01em;
}
.lbl .val {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  font-weight: 700;
}
fieldset.field {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
}
.checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checks label, .check-line {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.checks label:hover, .check-line:hover { color: var(--accent); }
input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex: 0 0 auto;
}

/* range sliders */
input[type="range"] {
  width: 100%;
  height: 28px;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  background: var(--line);
  border-radius: 999px;
}
input[type="range"]::-moz-range-track {
  height: 5px;
  background: var(--line);
  border-radius: 999px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  background: var(--accent);
  border: 3px solid var(--panel);
  border-radius: 50%;
  margin-top: -7px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  transition: transform .12s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--accent);
  border: 3px solid var(--panel);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

/* separator segment buttons */
.segs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.seg {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .12s ease;
}
.seg:hover { color: var(--ink); border-color: var(--line-strong); }
.seg.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.seg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── preview / password list ────────────────────────────── */
.pv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.pv-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.pv-foot {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  transition: all .12s ease;
}
.btn:hover { border-color: var(--line-strong); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 14px -8px var(--accent-glow);
}
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.ghost { background: var(--panel); }
.btn.ghost:hover { color: var(--accent); border-color: var(--accent); }

.pw-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pw-item {
  display: grid;
  grid-template-columns: 1fr 36px;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 4px 4px 14px;
  transition: border-color .12s;
}
.pw-item:hover { border-color: var(--line-strong); }
.pw-val {
  font-family: var(--mono);
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: .01em;
  word-break: break-all;
  user-select: all;
  color: var(--ink);
  min-width: 0;
}
.pw-copy {
  width: 36px; height: 36px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 15px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .12s ease;
}
.pw-copy:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.pw-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pw-copy:active { transform: scale(.92); }

.pin-list .pw-val { letter-spacing: .35em; font-size: 18px; font-weight: 600; }

.pw-empty {
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
  padding: 28px 12px;
  font-style: italic;
}
.pw-empty.is-err { color: var(--err); font-style: normal; }

/* ── strength meter ─────────────────────────────────────── */
.strength { padding: 20px; }
.st-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.st-input input {
  flex: 1 1 240px;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.st-input input::placeholder { color: var(--ink-faint); font-family: var(--sans); font-size: 13px; }
.st-input input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.st-gauge { margin-bottom: 8px; }
.st-track {
  height: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.st-fill {
  height: 100%;
  width: 0%;
  background: var(--st-0);
  border-radius: 999px;
  transition: width .25s ease, background .25s ease;
}
.st-band {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: .02em;
}
.st-label {
  text-align: center;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  margin: 8px 0 16px;
  color: var(--ink-faint);
  letter-spacing: -.01em;
}
.st-label.lvl-0 { color: var(--st-0); }
.st-label.lvl-1 { color: var(--st-1); }
.st-label.lvl-2 { color: var(--st-2); }
.st-label.lvl-3 { color: var(--st-3); }
.st-label.lvl-4 { color: var(--st-4); }

.st-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}
.stat-k {
  display: block;
  font-size: 11px;
  color: var(--ink-faint);
  margin-bottom: 4px;
  letter-spacing: .02em;
}
.stat-v {
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-all;
}
.st-warning {
  margin-top: 12px;
  padding: 10px 13px;
  background: rgba(192, 57, 43, 0.08);
  border: 1px solid rgba(192, 57, 43, 0.3);
  color: var(--err);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
@media (prefers-color-scheme: dark) {
  .st-warning { background: rgba(244, 112, 103, 0.1); border-color: rgba(244, 112, 103, 0.3); }
}
.st-foot {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

/* ── ad slots (money-lab pattern) ───────────────────────── */
.ad-slot { display: none; margin: 22px 0; }
.ad-slot.is-live, .ad-slot.is-preview { display: block; }
.ad-label {
  display: block;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  opacity: .8;
  margin-bottom: 5px;
  text-align: center;
}
.ad-ph {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--ink-faint);
  font-size: 12px;
  text-align: center;
}
.ad-slot.is-preview .ad-ph { display: flex; }
.ad-slot.is-preview .adsbygoogle { display: none !important; }
.ad-slot.is-live .ad-ph { display: none; }

/* ── info / FAQ ─────────────────────────────────────────── */
.info {
  margin-top: 28px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}
.info h2 {
  font-size: 15px;
  color: var(--ink);
  margin: 22px 0 8px;
}
.info > h2:first-child { margin-top: 0; }
.info p { margin-bottom: 8px; }
.info b { color: var(--ink); }
.faq { margin: 4px 0 8px; }
.faq dt { color: var(--ink); font-weight: 600; margin-top: 12px; }
.faq dd { margin: 4px 0 0; }

/* ── footer ─────────────────────────────────────────────── */
.foot {
  max-width: 880px;
  margin: 0 auto;
  padding: 8px clamp(16px, 5vw, 32px) 80px;
  text-align: center;
}
.foot a { color: var(--ink-faint); font-size: 12px; }
.foot a:hover { color: var(--accent); }

/* ── toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-err { background: var(--err); color: #fff; }

/* ── RTL ────────────────────────────────────────────────── */
[dir="rtl"] .panel-grid { grid-template-columns: 1fr minmax(220px, 320px); }
[dir="rtl"] .controls { border-right: 0; border-left: 1px solid var(--line); }

/* ── responsive ─────────────────────────────────────────── */
@media (max-width: 680px) {
  .panel-grid { grid-template-columns: 1fr; }
  .controls { border-right: 0; border-bottom: 1px solid var(--line); }
  [dir="rtl"] .controls { border-left: 0; }
  .st-stats { grid-template-columns: 1fr; }
  .brand h1 { font-size: 18px; }
  .strength { padding: 16px; }
}

@media (min-width: 760px) {
  .offline-badge { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
