:root {
    color-scheme: dark;
    --password-bg: #070709;
    --password-panel: rgba(22, 22, 27, .88);
    --password-panel-soft: rgba(255, 255, 255, .045);
    --password-text: #f7f5f7;
    --password-muted: rgba(255, 255, 255, .62);
    --password-subtle: rgba(255, 255, 255, .42);
    --password-border: rgba(255, 255, 255, .12);
    --password-accent: #ff3945;
    --password-accent-dark: #c7192a;
    --password-green: #69e5a5;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--password-bg); }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--password-text);
    font-family: 'Onest', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 86% -4%, rgba(255, 57, 69, .2), transparent 31rem),
        radial-gradient(circle at 3% 76%, rgba(255, 57, 69, .08), transparent 28rem),
        var(--password-bg);
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.password-page {
    width: min(1160px, calc(100% - 40px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 25px 0 34px;
}

.password-topbar,
.password-back,
.password-brand,
.password-card-heading,
.password-output-meta,
.strength-heading,
.password-control-heading,
.password-footer {
    display: flex;
    align-items: center;
}

.password-topbar { justify-content: space-between; gap: 20px; }

.password-language-control {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    position: relative;
    z-index: 10;
}

.password-back {
    gap: 9px;
    color: var(--password-muted);
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    transition: color .18s ease, transform .18s ease;
}

.password-back:hover { color: var(--password-text); transform: translateX(-2px); }

.password-brand { gap: 10px; color: var(--password-text); font-size: .95rem; font-weight: 800; }
.password-brand strong { color: var(--password-accent); }

.password-brand-mark {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid rgba(255, 57, 69, .48);
    border-radius: 10px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 900;
    background: linear-gradient(145deg, #ff3e4a, #c51a2a);
    box-shadow: 0 8px 22px rgba(255, 57, 69, .22);
}

.password-hero { max-width: 760px; padding: 78px 0 40px; }

.password-kicker,
.password-section-label {
    margin: 0;
    color: #ff9ca3;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .17em;
}

.password-hero h1 {
    max-width: 780px;
    margin: 13px 0 18px;
    font-size: clamp(2.55rem, 7vw, 5.6rem);
    line-height: .96;
    letter-spacing: -.065em;
}

.password-lead {
    max-width: 650px;
    margin: 0;
    color: var(--password-muted);
    font-size: 1.06rem;
    line-height: 1.65;
}

.password-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(290px, .75fr);
    gap: 22px;
    align-items: start;
}

.password-card,
.password-guide {
    border: 1px solid var(--password-border);
    border-radius: 27px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025));
    box-shadow: 0 26px 80px rgba(0, 0, 0, .28);
}

.password-card { padding: clamp(22px, 4vw, 34px); }
.password-guide { padding: 30px 27px; }

.password-card-heading { justify-content: space-between; gap: 16px; }
.password-card h2, .password-guide h2 { margin: 9px 0 0; letter-spacing: -.04em; }
.password-card h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
.password-guide h2 { font-size: 1.7rem; line-height: 1.08; }

.local-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid rgba(105, 229, 165, .22);
    border-radius: 999px;
    color: #a9efc8;
    font-size: .73rem;
    font-weight: 800;
    background: rgba(105, 229, 165, .08);
}

.local-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--password-green); box-shadow: 0 0 12px rgba(105, 229, 165, .8); }

.password-output-shell {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 27px;
    padding: 6px 7px 6px 16px;
    border: 1px solid rgba(255, 57, 69, .32);
    border-radius: 17px;
    background: rgba(5, 5, 8, .68);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 14px 45px rgba(0, 0, 0, .2);
}

.password-output {
    min-width: 0;
    flex: 1;
    padding: 9px 0;
    border: 0;
    outline: 0;
    color: #fff;
    background: transparent;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: clamp(.9rem, 2.2vw, 1.15rem);
    letter-spacing: .045em;
}

.password-output::selection { color: #fff; background: rgba(255, 57, 69, .48); }

.icon-button,
.copy-button,
.primary-button,
.reset-button { cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease; }

.icon-button {
    display: grid;
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    place-items: center;
    border: 1px solid var(--password-border);
    border-radius: 11px;
    color: var(--password-muted);
    background: rgba(255, 255, 255, .06);
}

.icon-button:hover { color: #fff; border-color: rgba(255, 57, 69, .5); background: rgba(255, 57, 69, .13); }
.icon-button svg, .copy-button svg, .primary-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.password-output-meta { justify-content: space-between; gap: 13px; margin-top: 12px; color: var(--password-subtle); font-size: .77rem; }

.copy-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid var(--password-border);
    border-radius: 10px;
    color: var(--password-text);
    font-size: .78rem;
    font-weight: 800;
    background: rgba(255, 255, 255, .06);
}

.copy-button:hover { border-color: rgba(255, 57, 69, .46); background: rgba(255, 57, 69, .13); }

.password-strength { margin-top: 27px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .08); }
.strength-heading { justify-content: space-between; gap: 14px; color: var(--password-muted); font-size: .8rem; font-weight: 700; }
.strength-heading strong { color: #a9efc8; }
.strength-track { height: 7px; margin-top: 11px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.strength-track span { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--password-green); box-shadow: 0 0 17px rgba(105, 229, 165, .36); transition: width .22s ease, background .22s ease; }
.strength-track span[data-strength="weak"] { background: #ff5a64; box-shadow: 0 0 17px rgba(255, 90, 100, .34); }
.strength-track span[data-strength="fair"] { background: #ffc45c; box-shadow: 0 0 17px rgba(255, 196, 92, .3); }
.strength-track span[data-strength="strong"] { background: #8bd9ff; box-shadow: 0 0 17px rgba(139, 217, 255, .3); }
.entropy-label { display: block; margin-top: 9px; color: var(--password-subtle); font-size: .74rem; }

.password-actions { display: grid; grid-template-columns: 1fr; margin-top: 22px; }

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 50px;
    border: 1px solid rgba(255, 57, 69, .58);
    border-radius: 14px;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, #ff3d48, var(--password-accent-dark));
    box-shadow: 0 13px 30px rgba(255, 57, 69, .2);
}

.primary-button:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(255, 57, 69, .29); }
.primary-button:active, .copy-button:active, .icon-button:active, .reset-button:active { transform: scale(.98); }
.copy-status { min-height: 19px; margin: 10px 0 0; color: #a9efc8; font-size: .76rem; text-align: center; }

.password-options { margin-top: 19px; padding-top: 23px; border-top: 1px solid rgba(255, 255, 255, .08); }
.password-control-heading { justify-content: space-between; gap: 14px; color: var(--password-muted); font-size: .87rem; font-weight: 800; }
.password-control-heading output { color: #fff; font-family: "SFMono-Regular", Consolas, monospace; }
.length-controls { display: grid; grid-template-columns: minmax(0, 1fr) 66px; align-items: center; gap: 14px; margin-top: 11px; }

input[type="range"] { width: 100%; height: 5px; appearance: none; border-radius: 999px; outline: none; background: linear-gradient(90deg, var(--password-accent) 0 11%, rgba(255, 255, 255, .14) 11% 100%); }
input[type="range"]::-webkit-slider-thumb { width: 21px; height: 21px; appearance: none; border: 3px solid #fff; border-radius: 50%; background: var(--password-accent); box-shadow: 0 0 0 4px rgba(255, 57, 69, .18), 0 4px 14px rgba(255, 57, 69, .35); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: 3px solid #fff; border-radius: 50%; background: var(--password-accent); box-shadow: 0 0 0 4px rgba(255, 57, 69, .18), 0 4px 14px rgba(255, 57, 69, .35); }

.length-number { width: 66px; padding: 9px 7px; border: 1px solid var(--password-border); border-radius: 10px; color: #fff; text-align: center; outline: 0; background: rgba(255, 255, 255, .06); }
.length-number:focus { border-color: rgba(255, 57, 69, .62); box-shadow: 0 0 0 3px rgba(255, 57, 69, .12); }

.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 22px; }
.option-row { display: flex; min-width: 0; align-items: center; gap: 10px; min-height: 42px; padding: 8px 10px; border: 1px solid var(--password-border); border-radius: 11px; color: var(--password-muted); font-size: .82rem; font-weight: 700; cursor: pointer; background: rgba(255, 255, 255, .035); transition: border-color .16s ease, background .16s ease, color .16s ease; }
.option-row:hover { border-color: rgba(255, 57, 69, .42); background: rgba(255, 57, 69, .08); }
.option-row input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.custom-check { display: grid; width: 18px; height: 18px; flex: 0 0 18px; place-items: center; border: 1px solid rgba(255, 255, 255, .27); border-radius: 6px; background: rgba(255, 255, 255, .045); transition: background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.custom-check::after { width: 8px; height: 4px; border-bottom: 2px solid #fff; border-left: 2px solid #fff; opacity: 0; transform: rotate(-45deg) translate(1px, -1px); transition: opacity .16s ease; content: ""; }
.option-row input:checked + .custom-check { border-color: var(--password-accent); background: var(--password-accent); box-shadow: 0 0 14px rgba(255, 57, 69, .28); }
.option-row input:checked + .custom-check::after { opacity: 1; }
.option-row input:focus-visible + .custom-check { outline: 3px solid rgba(255, 57, 69, .34); outline-offset: 2px; }
.option-row small { display: block; margin-top: 2px; color: var(--password-subtle); font-size: .68rem; font-weight: 600; }
.option-row-wide { margin-top: 9px; }
.reset-button { display: block; margin: 17px auto 0; padding: 4px 8px; border: 0; color: var(--password-subtle); font-size: .75rem; background: transparent; }
.reset-button:hover { color: #fff; }

.password-guide > p:not(.password-section-label) { margin: 17px 0 0; color: var(--password-muted); line-height: 1.6; }
.password-guide ul { display: grid; gap: 14px; margin: 24px 0 0; padding: 0; list-style: none; }
.password-guide li { display: flex; gap: 11px; color: var(--password-muted); font-size: .85rem; line-height: 1.45; }
.guide-icon { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; border: 1px solid rgba(105, 229, 165, .25); border-radius: 7px; color: var(--password-green); font-size: .75rem; background: rgba(105, 229, 165, .08); }
.privacy-note { display: flex; gap: 11px; margin-top: 30px; padding: 15px; border: 1px solid rgba(255, 57, 69, .2); border-radius: 14px; color: var(--password-muted); font-size: .75rem; line-height: 1.5; background: rgba(255, 57, 69, .07); }
.privacy-note svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: var(--password-accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.privacy-note strong { color: #fff; font-family: "SFMono-Regular", Consolas, monospace; font-size: .7rem; }

.password-faq {
    max-width: 900px;
    margin: 58px auto 0;
    padding: 30px clamp(20px, 4vw, 36px);
    border: 1px solid var(--password-border);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02));
}

.password-faq h2 { margin: 9px 0 21px; font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.04em; }
.faq-list { display: grid; gap: 9px; }
.faq-list details { border: 1px solid rgba(255, 255, 255, .1); border-radius: 13px; background: rgba(255, 255, 255, .035); transition: border-color .16s ease, background .16s ease; }
.faq-list details[open] { border-color: rgba(255, 57, 69, .35); background: rgba(255, 57, 69, .06); }
.faq-list summary { padding: 16px 18px; color: var(--password-text); font-size: .88rem; font-weight: 800; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { float: right; margin-left: 12px; color: var(--password-accent); content: "+"; font-size: 1.15rem; line-height: 1; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { margin: 0; padding: 0 18px 17px; color: var(--password-muted); font-size: .82rem; line-height: 1.55; }
.faq-list details p strong { color: #fff; font-family: "SFMono-Regular", Consolas, monospace; font-size: .76rem; }

.password-footer { justify-content: center; gap: 9px; margin-top: 36px; color: var(--password-subtle); font-size: .76rem; }
.password-footer a { color: inherit; text-decoration: none; }
.password-footer a:hover { color: #fff; }

.password-back:focus-visible, .password-footer a:focus-visible, .icon-button:focus-visible, .copy-button:focus-visible, .primary-button:focus-visible, .reset-button:focus-visible, .password-language-control select:focus-visible { outline: 3px solid rgba(255, 57, 69, .45); outline-offset: 3px; }

@media (max-width: 800px) {
    .password-page { width: min(100% - 28px, 620px); padding-top: 18px; }
    .password-hero { padding: 60px 0 30px; }
    .password-layout { grid-template-columns: 1fr; }
    .password-guide { padding: 24px 22px; }
}

@media (max-width: 560px) {
    .password-topbar { gap: 10px; }
    .password-brand { gap: 7px; font-size: .85rem; }
    .password-brand-mark { width: 29px; height: 29px; border-radius: 9px; font-size: 1rem; }
    .password-language-control .site-language-picker-trigger { min-width: 132px; }
}

@media (max-width: 470px) {
    .password-page { width: min(100% - 22px, 620px); }
    .password-back span { display: none; }
    .password-hero h1 { font-size: clamp(2.35rem, 13vw, 3.5rem); }
    .password-card { padding: 20px 16px; border-radius: 22px; }
    .password-output-shell { padding-left: 12px; }
    .password-output { font-size: .82rem; }
    .option-grid { grid-template-columns: 1fr; }
    .password-output-meta { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
