/* pwd.chromoshub.ru — password generator */
:root {
    --bg: #0d1117;
    --bg-2: #161b22;
    --bg-3: #1c2430;
    --card: #10151d;
    --line: #26303c;
    --line-2: #313d4d;
    --txt: #e6edf3;
    --txt-2: #9aa7b4;
    --txt-3: #6b7684;
    --accent: #6ea8fe;
    --accent-2: #3b82f6;
    --weak: #f85149;
    --fair: #d29922;
    --good: #3fb950;
    --strong: #2ea043;
    --mono: "JetBrains Mono", "Cascadia Code", "Fira Code", "DejaVu Sans Mono", "Consolas", monospace;
    --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="light"] {
    --bg: #f4f7fa;
    --bg-2: #ffffff;
    --bg-3: #eef2f6;
    --card: #ffffff;
    --line: #dde4ec;
    --line-2: #c9d2de;
    --txt: #16202b;
    --txt-2: #52616f;
    --txt-3: #808d9b;
    --accent: #2563eb;
    --accent-2: #1d4ed8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: var(--ui);
    background:
        radial-gradient(900px 500px at 85% -10%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%),
        var(--bg);
    color: var(--txt);
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; }
.brand__mark { font-size: 18px; }
.actions { display: flex; align-items: center; gap: 10px; }
.lang { display: inline-flex; height: 32px; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.lang__btn {
    font-family: var(--mono); font-size: 11px; font-weight: 600;
    padding: 0 9px; border: 0; background: var(--bg-3); color: var(--txt-2); cursor: pointer;
    transition: background .12s, color .12s;
}
.lang__btn + .lang__btn { border-left: 1px solid var(--line-2); }
.lang__btn:hover { color: var(--accent); }
.lang__btn.is-active { background: var(--accent-2); color: #fff; }
.icon-btn {
    width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-3); color: var(--txt-2); cursor: pointer;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .i-moon { display: none; }
:root[data-theme="light"] .icon-btn .i-sun { display: none; }
:root[data-theme="light"] .icon-btn .i-moon { display: block; }

.wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 18px; }
.card {
    width: 100%; max-width: 560px;
    background: var(--card); border: 1px solid var(--line); border-radius: 16px;
    padding: 26px 24px; box-shadow: 0 16px 50px rgba(0,0,0,.28);
}

/* Output */
.out { display: flex; gap: 8px; align-items: stretch; }
.out__field {
    flex: 1; min-width: 0;
    font-family: var(--mono); font-size: clamp(1rem, 3.6vw, 1.35rem);
    padding: 14px 14px; letter-spacing: .5px;
    background: var(--bg-3); color: var(--txt);
    border: 1px solid var(--line-2); border-radius: 11px; outline: none;
    word-break: break-all;
}
.out__field:focus { border-color: var(--accent); }
.out__btn {
    flex: 0 0 auto; width: 48px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-3); color: var(--txt-2);
    border: 1px solid var(--line-2); border-radius: 11px; cursor: pointer;
    transition: color .12s, border-color .12s;
}
.out__btn:hover { color: var(--accent); border-color: var(--accent); }
.out__btn svg { width: 19px; height: 19px; }
.copied { color: var(--good); font-size: 12px; margin-top: 8px; height: 14px; }

/* Strength */
.strength { margin: 18px 0 4px; }
.strength__bar { height: 7px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.strength__bar span {
    display: block; height: 100%; width: 0;
    border-radius: 999px; transition: width .2s, background .2s;
}
.strength__meta { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; }
.strength__label { font-weight: 600; }
.strength__entropy { color: var(--txt-3); font-family: var(--mono); }

/* Length */
.row--length { margin: 22px 0 6px; }
.row--length label { display: block; font-size: 14px; color: var(--txt-2); margin-bottom: 8px; }
.row--length b { color: var(--txt); font-family: var(--mono); }
.range {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 6px; border-radius: 999px; background: var(--bg-3); outline: none;
}
.range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 20px; height: 20px; border-radius: 50%; background: var(--accent-2); cursor: pointer;
    border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--accent-2);
}
.range::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%; background: var(--accent-2); cursor: pointer; border: 0;
}

/* Options */
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 18px 0 22px; }
.opt { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--txt); cursor: pointer; }
.opt input { width: 17px; height: 17px; accent-color: var(--accent-2); cursor: pointer; }

.generate {
    width: 100%; padding: 13px; font-size: 15px; font-weight: 600;
    color: #fff; background: var(--accent-2); border: 0; border-radius: 11px; cursor: pointer;
    transition: background .12s, transform .12s;
}
.generate:hover { background: var(--accent); }
.generate:active { transform: translateY(1px); }

.note { margin-top: 16px; font-size: 12px; color: var(--txt-3); text-align: center; line-height: 1.5; }

@media (max-width: 440px) {
    .opts { grid-template-columns: 1fr; }
}
