:root {
    --bg: #0f1419;
    --surface: #1a2332;
    --border: #2d3a4d;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --success: #3fb950;
    --radius: 12px;
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100%;
    overflow-wrap: break-word;
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 0 20px;
    min-width: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
.header {
    padding: 2rem 0 0.75rem;
}

.site-title {
    margin: 0;
    font-size: clamp(0.95rem, 2.2vw + 0.9rem, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tagline {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}

/* Main */
.main {
    flex: 1;
    padding: 1rem 0 3rem;
}

.generator-section {
    margin-bottom: 2.5rem;
}

.generator-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.output-row {
    display: flex;
    gap: 10px;
    margin-bottom: 1.25rem;
}

.password-output {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    font-family: ui-monospace, monospace;
    letter-spacing: 0.05em;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
}

.password-output::placeholder {
    color: var(--muted);
    opacity: 1;
}

.password-output:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.password-output:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.btn {
    padding: 12px 18px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-copy {
    background: var(--border);
    color: var(--text);
    width: 110px;
    padding: 10px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #3d4d66;
}

.btn-copy.copied {
    background: var(--success);
    color: #fff;
}

.btn-primary {
    width: 100%;
    background: var(--accent);
    color: #0d1117;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.range:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent);
}

.checkbox-label input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent);
}

.content-section a:focus-visible,
.check-intro a:focus-visible,
.nav-links a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent);
    border-radius: 2px;
}

.options {
    margin-bottom: 1.25rem;
}

.option-row {
    margin-bottom: 0.75rem;
}

.option-row:last-of-type {
    margin-bottom: 0;
}

.option-row label {
    display: block;
    font-size: 0.9375rem;
    color: var(--text);
}

.range {
    width: 100%;
    height: 8px;
    margin-top: 6px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Content section — SEO-текст */
.content-section {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.content-section h2 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.content-section p {
    color: var(--muted);
}

.content-section p:first-of-type {
    font-size: 1rem;
    font-weight: 500;
}

.content-section ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

.content-section strong {
    color: var(--muted);
}

.content-section a {
    color: var(--accent);
    text-decoration: underline;
}

.content-section a:hover {
    color: var(--accent-hover);
}

/* Footer */
.footer {
    padding: 1rem 0 1.5rem;
    border: none;
}

.footer p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted);
}

.footer a {
    color: var(--accent);
}

.footer-nav {
    margin-top: 0;
    text-align: center;
}

.footer-copyright {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    color: var(--muted);
}

/* Nav */
.nav-links {
    margin-top: 0.5rem;
    font-size: 0.9375rem;
}

.nav-links a {
    color: var(--accent);
    text-decoration: none;
}

.nav-links a:hover {
    text-decoration: underline;
}

.nav-sep {
    color: var(--muted);
    margin: 0 0.35rem;
}

.nav-current {
    color: var(--muted);
}

/* Check password page */
.page-subtitle {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.check-intro {
    margin: 1rem 0 0;
    font-size: 0.9375rem;
    color: var(--muted);
}

.check-intro:first-of-type {
    font-size: 1rem;
    font-weight: 500;
}

.check-intro a {
    color: var(--accent);
    text-decoration: underline;
}

.check-intro a:hover {
    color: var(--accent-hover);
}

.check-intro-list {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    font-size: 0.9375rem;
    color: var(--muted);
}

.check-intro-list li {
    margin-bottom: 0.25rem;
}

.copy-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    color: #fff;
    background: var(--success);
    border: 1px solid var(--success);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.copy-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.check-result {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.check-result.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.strength-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.strength-label {
    flex-shrink: 0;
    font-size: 0.9375rem;
}

.strength-bar-wrap {
    flex: 1;
    min-width: 80px;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.2s, background 0.2s;
}

.strength-bar.strength-0 { background: #f85149; }
.strength-bar.strength-1 { background: #d29922; }
.strength-bar.strength-2 { background: #9e6a03; }
.strength-bar.strength-3 { background: #3fb950; }
.strength-bar.strength-4 { background: #238636; }

.strength-text {
    font-weight: 600;
    font-size: 0.9375rem;
}

.check-detail {
    margin: 0 0 0.25rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.check-tips-label {
    margin: 0.75rem 0 0.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
}

.check-tips {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.875rem;
    color: var(--text);
}

.check-tips li {
    margin-bottom: 0.25rem;
}

.check-tips a {
    color: var(--accent);
    text-decoration: underline;
}

.check-tips a:hover {
    color: var(--accent-hover);
}

@media (max-width: 480px) {
    .output-row {
        gap: 8px;
    }

    .password-output {
        padding: 10px 10px;
        font-size: 0.875rem;
    }

    .btn-copy {
        flex-shrink: 0;
        padding: 10px 12px;
        font-size: 0.875rem;
    }
}
