* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f7f6f2;
    --text: #171717;
    --muted: #5f6368;
    --card: #ffffff;
    --border: #d7d7d7;
    --accent: #e11d48;
    --accent-dark: #be123c;
    --success: #256c3f;
    --success-soft: #e2f2e4;
    --panel: #dff0df;
    --shadow: 0 30px 60px rgba(15, 23, 42, 0.08);
}

body {
    font-family: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: linear-gradient(180deg, #faf9f6 0%, #f0f4ec 100%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.page {
    width: min(980px, 92vw);
    padding: 40px 0 60px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.back-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hero h1 {
    font-size: clamp(2rem, 1.3rem + 2vw, 3rem);
    line-height: 1.15;
}

.hero p {
    color: var(--muted);
    font-size: 1.05rem;
}

.generator {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.password-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow);
}

#password-output {
    border: none;
    font-size: clamp(1.2rem, 1rem + 1vw, 1.5rem);
    font-weight: 600;
    color: var(--text);
    background: transparent;
    width: 100%;
}

#password-output:focus {
    outline: none;
}

.password-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #f4f4f4;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.icon-button svg {
    width: 20px;
    height: 20px;
}

.icon-button:hover {
    background: #ededed;
}

.copy-button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.copy-button:hover {
    background: var(--accent-dark);
}

.strength {
    display: flex;
    align-items: center;
    gap: 12px;
}

.strength-bar {
    flex: 1;
    height: 10px;
    border-radius: 999px;
    background: #d7ead6;
    position: relative;
    overflow: hidden;
}

.strength-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #3f8c5a, #2f6f46);
    transition: width 0.3s ease;
}

.strength-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 110px;
    justify-content: flex-end;
}

.strength-label {
    color: var(--success);
    font-weight: 600;
}

.strength-pill {
    background: var(--success-soft);
    color: var(--success);
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
}

.strength.weak .strength-fill {
    width: 35%;
    background: linear-gradient(90deg, #e25858, #c53a3a);
}

.strength.medium .strength-fill {
    width: 65%;
    background: linear-gradient(90deg, #f4b740, #e07f12);
}

.strength.strong .strength-fill {
    width: 100%;
    background: linear-gradient(90deg, #3f8c5a, #2f6f46);
}

.config-panel {
    background: var(--panel);
    padding: 24px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
}

.config-panel::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--panel);
    top: -9px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}

.length-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-weight: 600;
}

#length-value {
    font-weight: 700;
    margin-left: 6px;
}

#length-range {
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, #111 0%, #111 35%, #a7b5a7 35%);
    outline: none;
}

#length-range::-webkit-slider-thumb {
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #111;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#length-range::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #111;
    cursor: pointer;
}

.options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    align-items: center;
}

.options > span {
    font-weight: 600;
}

.option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.option input {
    width: 18px;
    height: 18px;
    accent-color: #111;
}

.footer {
    text-align: center;
    color: var(--muted);
}

.footer a {
    color: inherit;
}

@media (max-width: 700px) {
    .password-card {
        flex-direction: column;
        align-items: stretch;
    }

    .password-actions {
        justify-content: space-between;
        width: 100%;
    }

    .strength {
        flex-direction: column;
        align-items: stretch;
    }

    .strength-meta {
        justify-content: space-between;
    }
}
