*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── THEME VARIABLES ─────────────────────────────────────── */
:root {
  --red:       #e73036;
  --red-lt:    #f24a50;
  --green:     #2ec47a;
  --yellow:    #f5c842;
  --font-head: 'Barlow', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* Dark theme (default) */
[data-theme="dark"] {
  --bg-header:  #002048;
  --bg-page:    #1F1F21;
  --bg-card:    #303134;
  --bg-input:   #262628;
  --bg-check:   #262628;
  --border:     rgba(255,255,255,.08);
  --border-cb:  rgba(255,255,255,.07);
  --text:       #ffffff;
  --text-muted: #8a9bbf;
  --text-dim:   #4a5f82;
  --sw-bg:      rgba(255,255,255,.06);
  --sw-border:  rgba(255,255,255,.10);
  --sw-hover:   rgba(255,255,255,.08);
  --str-bg:     rgba(255,255,255,.08);
  --divider:    rgba(255,255,255,.07);
  --footer-border: rgba(255,255,255,.06);
  --logo-filter: none;
}

/* Light theme */
[data-theme="light"] {
  --bg-header:  #002048;
  --bg-page:    #E9EAED;
  --bg-card:    #FFFFFF;
  --bg-input:   #f0f1f4;
  --bg-check:   #f0f1f4;
  --border:     rgba(0,0,0,.08);
  --border-cb:  rgba(0,0,0,.09);
  --text:       #1a1a2e;
  --text-muted: #4a5f82;
  --text-dim:   #8a9bbf;
  --sw-bg:      rgba(255,255,255,.15);
  --sw-border:  rgba(255,255,255,.25);
  --sw-hover:   rgba(255,255,255,.25);
  --str-bg:     rgba(0,0,0,.08);
  --divider:    rgba(0,0,0,.07);
  --footer-border: rgba(0,0,0,.08);
}

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background .2s, color .2s;
}

/* ── HEADER ─────────────────────────────────────────────── */
header {
  background: var(--bg-header);
  border-bottom: 3px solid var(--red);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: 6px;
  transition: opacity .15s;
}
.header-left:hover { opacity: .85; }
.header-left:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.logo-img {
  width: 190px;
  height: auto;
  display: block;
  filter: var(--logo-filter);
}

.header-divider {
  width: 1px;
  height: 26px;
  background: rgba(255,255,255,.18);
}

.header-tool-name {
  font-family: var(--font-head);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
}

.header-right {
  display: flex;
  align-items: center;
  gap: .6rem;
}

/* ── SWITCHERS (lang + theme) ────────────────────────────── */
.switcher-group {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--sw-bg);
  border: 1px solid var(--sw-border);
  border-radius: 6px;
  padding: 3px;
}

.sw-btn {
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255,255,255,.55);
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  padding: .22rem .48rem;
  cursor: pointer;
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  min-width: 28px;
  min-height: 24px;
}

.sw-btn svg {
  width: 14px;
  height: 14px;
}

.sw-btn:hover {
  color: #fff;
  background: var(--sw-hover);
}

.sw-btn.active {
  background: var(--red);
  color: #fff;
}

/* ── MAIN ────────────────────────────────────────────────── */
main {
  flex: 1;
  padding: 1.25rem 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 680px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  transition: background .2s;
}

/* ── OUTPUT ──────────────────────────────────────────────── */
.output-section { display: flex; flex-direction: column; gap: .45rem; }

.output-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.password-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 52px;
}

#password-display {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .08em;
  word-break: break-all;
  color: var(--text);
  user-select: all;
  line-height: 1.4;
}

#password-display.placeholder {
  color: var(--text-dim);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

.icon-btn {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border: none; border-radius: 6px;
  background: var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--red); color: #fff; }
.icon-btn svg { width: 15px; height: 15px; }

.strength-row { display: flex; align-items: center; gap: .75rem; }
.strength-bar-wrap {
  flex: 1; height: 3px;
  background: var(--str-bg);
  border-radius: 99px; overflow: hidden;
}
.strength-bar { height: 100%; border-radius: 99px; transition: width .3s, background .3s; width: 0%; }
.strength-label {
  font-size: .68rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  min-width: 60px; text-align: right;
  color: var(--text-dim);
}

/* ── DIVIDER ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--divider); margin: 0 -.25rem; }

/* ── SECTION LABEL ───────────────────────────────────────── */
.section-label {
  font-size: .68rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: .6rem;
}

/* ── TWO-COLUMN ──────────────────────────────────────────── */
.controls-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── SLIDER ──────────────────────────────────────────────── */
.slider-wrap { display: flex; flex-direction: column; gap: .5rem; }
.slider-header { display: flex; justify-content: space-between; align-items: baseline; }
.slider-title { font-size: .88rem; font-weight: 500; color: var(--text); }
.slider-value { font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; color: var(--red); line-height: 1; }

input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 4px;
  background: var(--str-bg); border-radius: 99px; outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 3px rgba(231,48,54,.25); cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb:hover { box-shadow: 0 0 0 6px rgba(231,48,54,.35); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--red); border: none; cursor: pointer; }

.range-labels { display: flex; justify-content: space-between; font-size: .65rem; color: var(--text-dim); }

/* ── CHECKBOXES ──────────────────────────────────────────── */
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }

.check-card {
  background: var(--bg-check);
  border: 1.5px solid var(--border-cb);
  border-radius: 7px; padding: .55rem .8rem;
  display: flex; align-items: center; gap: .6rem;
  cursor: pointer; transition: border-color .15s, background .15s; user-select: none;
}
.check-card:hover { border-color: rgba(231,48,54,.4); background: rgba(231,48,54,.04); }
.check-card.active { border-color: var(--red); background: rgba(231,48,54,.08); }
.check-card input[type="checkbox"] { display: none; }

.check-icon {
  width: 18px; height: 18px; border: 2px solid var(--text-dim); border-radius: 4px;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.active .check-icon { background: var(--red); border-color: var(--red); }
.check-icon svg { width: 11px; height: 11px; fill: none; stroke: #fff; stroke-width: 2.5; opacity: 0; transition: opacity .1s; }
.active .check-icon svg { opacity: 1; }

.check-name { font-size: .82rem; font-weight: 500; color: var(--text); }
.check-sample { font-size: .68rem; color: var(--text-muted); font-family: 'Courier New', monospace; letter-spacing: .03em; margin-top: 1px; }

/* ── BOTTOM ROW ──────────────────────────────────────────── */
.bottom-row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: start; }

.exclude-wrap { display: flex; flex-direction: column; gap: .35rem; }

.exclude-input {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 6px; padding: .5rem .9rem;
  color: var(--text); font-family: 'Courier New', monospace;
  font-size: .9rem; letter-spacing: .06em;
  outline: none; transition: border-color .15s; width: 100%;
}
.exclude-input:focus { border-color: var(--red); }
.exclude-hint { font-size: .68rem; color: var(--text-dim); }

.count-wrap { display: flex; flex-direction: column; gap: .35rem; }
.count-stepper { display: flex; align-items: center; gap: .4rem; }
.stepper-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--border); border-radius: 5px;
  background: var(--bg-input); color: var(--text);
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.stepper-btn:hover { background: var(--red); border-color: var(--red); color: #fff; }
#count-display { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; color: var(--red); min-width: 24px; text-align: center; }

/* ── MULTI LIST ──────────────────────────────────────────── */
.multi-list { display: flex; flex-direction: column; gap: .35rem; }
.multi-pw-row {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 6px; padding: .45rem .85rem;
  display: flex; align-items: center; gap: .5rem;
  font-family: 'Courier New', monospace; font-size: .88rem; letter-spacing: .05em; color: var(--text);
}
.multi-pw-row span { flex: 1; word-break: break-all; }
.multi-pw-row .icon-btn { width: 26px; height: 26px; }

/* ── GENERATE BUTTON ─────────────────────────────────────── */
.generate-btn {
  background: var(--red); border: none; border-radius: 7px;
  color: #fff; font-family: var(--font-head); font-size: 1rem;
  font-weight: 700; letter-spacing: .04em; padding: .75rem 1.5rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: .5rem; transition: background .15s, transform .1s;
}
.generate-btn:hover { background: var(--red-lt); }
.generate-btn:active { transform: scale(.98); }
.generate-btn svg { width: 17px; height: 17px; }

/* ── TOAST ───────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--green); color: #fff;
  font-size: .83rem; font-weight: 600;
  padding: .55rem 1.1rem; border-radius: 99px;
  opacity: 0; transition: opacity .25s, transform .25s;
  pointer-events: none; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--footer-border);
  padding: .7rem 2rem;
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; font-size: .7rem; color: var(--text-dim); flex-shrink: 0;
}
footer svg { width: 13px; height: 13px; fill: var(--red); flex-shrink: 0; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .controls-row { grid-template-columns: 1fr; }
  .bottom-row   { grid-template-columns: 1fr; }
  .card { padding: 1rem; }
  .header-tool-name { display: none; }
}

/* ── FOOTER EXTRAS ───────────────────────────────────────── */
.footer-sep {
  color: var(--text-dim);
  margin: 0 .15rem;
}

/* ══════════════════════════════════════════════════════════
   ONETIMESECRET — additional components
   ══════════════════════════════════════════════════════════ */

/* ── SECRET TEXTAREA ─────────────────────────────────────── */
.secret-textarea-wrap { display: flex; flex-direction: column; gap: .4rem; }

.secret-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .85rem 1rem;
  color: var(--text);
  font-family: 'Courier New', monospace;
  font-size: .95rem;
  line-height: 1.5;
  min-height: 140px;
  resize: vertical;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
.secret-textarea:focus { border-color: var(--red); }
.secret-textarea::placeholder { color: var(--text-dim); font-family: var(--font-body); font-style: italic; }

.textarea-footer {
  display: flex; justify-content: flex-end;
  font-size: .68rem; color: var(--text-dim);
}
.textarea-footer.over-limit { color: var(--red); font-weight: 600; }

/* ── EXPIRY PILLS ────────────────────────────────────────── */
.pill-group { display: flex; gap: .5rem; flex-wrap: wrap; }
.pill {
  background: var(--bg-check);
  border: 1.5px solid var(--border-cb);
  border-radius: 99px;
  padding: .45rem 1rem;
  font-size: .82rem; font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
}
.pill:hover { border-color: rgba(231,48,54,.4); }
.pill.active { background: var(--red); border-color: var(--red); color: #fff; }

/* ── PASSPHRASE FIELD ────────────────────────────────────── */
.passphrase-input {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: .7rem 1rem;
  color: var(--text); font-family: var(--font-body);
  font-size: .9rem; outline: none; transition: border-color .15s; width: 100%;
}
.passphrase-input:focus { border-color: var(--red); }
.passphrase-hint { font-size: .68rem; color: var(--text-dim); margin-top: .35rem; }

/* ── RESULT LINK BOX ─────────────────────────────────────── */
.link-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 52px;
}
#link-display {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: .88rem;
  word-break: break-all;
  color: var(--text);
  user-select: all;
  line-height: 1.4;
}
.result-hint { font-size: .75rem; color: var(--text-muted); line-height: 1.5; }

/* ── BURN WARNING / CONFIRM SCREEN ──────────────────────── */
.burn-box {
  background: rgba(231,48,54,.08);
  border: 1.5px solid rgba(231,48,54,.35);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  align-items: flex-start;
}
.burn-icon { width: 28px; height: 28px; color: var(--red); flex-shrink: 0; }
.burn-title { font-family: var(--font-head); font-size: 1.05rem; font-weight: 700; color: var(--text); }
.burn-text  { font-size: .85rem; color: var(--text-muted); line-height: 1.55; }

.reveal-btn {
  background: var(--red); border: none; border-radius: 7px;
  color: #fff; font-family: var(--font-head); font-size: 1rem;
  font-weight: 700; letter-spacing: .03em; padding: .8rem 1.6rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: .55rem; transition: background .15s, transform .1s; width: 100%;
}
.reveal-btn:hover { background: var(--red-lt); }
.reveal-btn:active { transform: scale(.98); }
.reveal-btn:disabled { opacity: .55; cursor: default; }
.reveal-btn svg { width: 17px; height: 17px; }

/* ── SECRET REVEAL BOX ───────────────────────────────────── */
.secret-reveal {
  background: rgba(46,196,122,.08);
  border: 1.5px solid rgba(46,196,122,.35);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: .6rem;
}
.secret-reveal-text {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: .85rem 1rem;
  font-family: 'Courier New', monospace; font-size: .95rem;
  color: var(--text); white-space: pre-wrap; word-break: break-word;
  max-height: 320px; overflow-y: auto; user-select: all;
}

/* ── STATE / ERROR MESSAGES ──────────────────────────────── */
.state-box {
  display: flex; flex-direction: column; align-items: center;
  gap: .8rem; text-align: center; padding: 1.5rem 1rem;
}
.state-icon { width: 42px; height: 42px; }
.state-icon.error   { color: var(--red); }
.state-icon.info    { color: var(--text-muted); }
.state-title { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; color: var(--text); }
.state-text  { font-size: .85rem; color: var(--text-muted); max-width: 40ch; line-height: 1.55; }

.form-error {
  font-size: .78rem; color: var(--red); font-weight: 600;
  display: none;
}
.form-error.show { display: block; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.secondary-btn {
  background: transparent; border: 1.5px solid var(--border-cb);
  border-radius: 7px; color: var(--text);
  font-family: var(--font-head); font-size: .9rem; font-weight: 600;
  padding: .65rem 1.3rem; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.secondary-btn:hover { border-color: var(--red); background: rgba(231,48,54,.06); }

/* ── CAPTCHA ──────────────────────────────────────────────── */
.captcha-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.captcha-img {
  height: 50px; width: 150px;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; /* the image is rendered on a fixed light background regardless of theme */
  flex-shrink: 0;
}
.captcha-input { flex: 1; min-width: 140px; font-family: 'Courier New', monospace; letter-spacing: .1em; }
