/* ============================================================
   HASH GENERATOR — bento console, soft classic theme.
   Shares the visual language of the password generator.
   ============================================================ */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --ink: #1e232a;
  --muted: #5b6571;
  --subtle: #8a939d;
  --line: #e3e7ec;
  --accent: #4f63a0;          /* muted indigo */
  --accent-soft: #eceff7;
  --good: #4f8a6b;
  --danger: #c0563f;
  --shadow: 0 12px 32px -20px rgba(30, 40, 60, 0.30);
  --radius: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171b;
    --surface: #1b1f25;
    --surface-2: #222730;
    --ink: #e7eaef;
    --muted: #9aa4af;
    --subtle: #6f7883;
    --line: #2a3038;
    --accent: #91a3d4;
    --accent-soft: #232a3a;
    --good: #79b393;
    --danger: #e08570;
    --shadow: 0 20px 48px -24px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; }
code { font-family: var(--mono); font-size: 0.9em; color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.site-header {
  position: sticky; top: 0; z-index: 20; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 44px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.logo-link { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 750; }
.logo-link img { display: block; }
.logo-link small { display: block; font-size: 9.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.home-link { color: var(--muted); font-size: 13px; font-weight: 650; }
.home-link:hover { color: var(--accent); }

.app-shell { width: min(1480px, 100%); margin: 0 auto; padding: clamp(18px, 3vw, 38px); }
.vault { width: min(1040px, 100%); }
.vault-hero { text-align: center; display: grid; gap: 10px; margin-bottom: 22px; }
.vault-hero .eyebrow { justify-self: center; }
.vault-hero .lede { color: var(--muted); max-width: 62ch; margin: 0 auto; }

.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.cell {
  display: grid; gap: 11px; align-content: start; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.span-3 { grid-column: span 3; }
.span-6 { grid-column: span 6; }
.cell h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 800; margin: 0; }
.cell-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cell-foot { margin: 0; color: var(--subtle); font-size: 11px; }
.opt { color: var(--subtle); font-weight: 700; text-transform: none; letter-spacing: 0; }

.eyebrow { margin: 0; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(30px, 5vw, 54px); line-height: 1.0; letter-spacing: -0.02em; font-weight: 820; color: var(--ink); }

/* Segmented Text / File control */
.seg { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.seg-btn { border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: 12px; padding: 6px 16px; border-radius: 8px; cursor: pointer; }
.seg-btn.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.range-value { color: var(--accent); font-family: var(--mono); font-size: 12px; font-weight: 800; }

textarea {
  width: 100%; min-height: 132px; resize: vertical; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); color: var(--ink); padding: 12px; outline: none; font-family: var(--mono); font-size: 13px; line-height: 1.5;
}
textarea:focus, input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }

.dropzone {
  display: grid; place-items: center; gap: 8px; min-height: 132px; padding: 18px; text-align: center; cursor: pointer;
  border: 1px dashed var(--line); border-radius: 11px; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600;
}
.dropzone:hover { border-color: var(--accent); color: var(--accent); }
.dropzone input[type="file"] { max-width: 100%; }

.field { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
input[type="text"] { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); padding: 11px 12px; outline: none; font-family: var(--mono); }
.check-line { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: 13px; font-weight: 600; }
.check-line input { accent-color: var(--accent); width: 16px; height: 16px; }

/* Result rows */
.results { display: grid; gap: 10px; }
.result {
  display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
}
.result .algo { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.result .digest { font-family: var(--mono); font-size: 12.5px; word-break: break-all; color: var(--ink); min-width: 0; }
.result .digest.is-empty { color: var(--subtle); }
.icon-btn {
  min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-weight: 800; font-size: 13px; cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn.is-ok { border-color: var(--good); color: var(--good); }

/* Password hashing */
.pw-bento { margin-top: 14px; }
.pw-row { display: flex; gap: 12px; flex-wrap: wrap; }
.pw-grow { flex: 1; min-width: 200px; }
select, input[type="number"] { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); padding: 11px 12px; outline: none; font-family: var(--mono); }
select:focus, input[type="number"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 22px; }
.pw-params { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#params-bcrypt { grid-template-columns: 1fr; }
.pw-btn {
  justify-self: start; min-height: 44px; padding: 0 22px; border: 1px solid var(--accent); border-radius: 11px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; cursor: pointer;
  transition: opacity 0.12s ease;
}
.pw-btn:hover { opacity: 0.9; }
.pw-btn:disabled { opacity: 0.55; cursor: progress; }
.output-card { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.pw-out .digest { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; word-break: break-all; color: var(--ink); }
.pw-out .digest.is-error { color: var(--danger); }

/* Info + FAQ */
.info { margin-top: 18px; padding: clamp(20px, 3vw, 30px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); display: grid; gap: 18px; }
.info-intro h2 { font-size: clamp(20px, 2.6vw, 30px); margin: 6px 0 8px; letter-spacing: -0.01em; text-transform: none; color: var(--ink); font-weight: 820; }
.info-intro p { color: var(--muted); margin: 0; }
.faq { display: grid; gap: 10px; }
.faq-2col { grid-template-columns: 1fr 1fr; align-items: start; }
details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 0 16px; }
summary { cursor: pointer; font-weight: 750; padding: 13px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink); }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-weight: 800; font-size: 17px; }
details[open] summary::after { content: "\2013"; }
details > p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.55; }

.site-footer { max-width: 1480px; margin: 0 auto; padding: 26px clamp(18px, 3vw, 38px) 38px; display: flex; gap: 16px; justify-content: space-between; color: var(--subtle); font-size: 12px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }

@media (max-width: 880px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3, .span-6 { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .app-shell { padding: 14px; }
  .faq-2col { grid-template-columns: 1fr; }
  .result { grid-template-columns: 1fr; gap: 6px; }
  .result .icon-btn { justify-self: start; }
  .site-header { padding: 0 14px; }
  .home-link { display: none; }
  .site-footer { flex-direction: column; }
}

/* lang-switcher */
.lang-switcher { position: relative; border: 0; padding: 0; background: none; margin-left: auto; margin-right: 14px; }
.lang-switcher > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2, transparent); color: var(--muted); font-size: 13px; font-weight: 700; }
.lang-switcher > summary::-webkit-details-marker { display: none; }
.lang-switcher > summary::marker { content: ""; }
.lang-switcher > summary:hover { color: var(--accent); border-color: var(--accent); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; display: grid; gap: 2px; max-height: 64vh; overflow: auto; min-width: 190px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow, 0 14px 36px rgba(0,0,0,.25)); }
.lang-menu a { padding: 7px 10px; border-radius: 8px; color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.lang-menu a:hover { background: var(--surface-2); color: var(--accent); }
.lang-switcher[dir="rtl"] .lang-menu, [dir="rtl"] .lang-menu { right: auto; left: 0; }
@media (max-width: 720px) { .lang-switcher { display: none; } }
