:root {
    --bg: #ffffff;
    --surface: rgba(255, 255, 255, 0.96);
    --surface-strong: #ffffff;
    --border: rgba(32, 52, 71, 0.12);
    --text: #142433;
    --muted: #586776;
    --primary: #174a7c;
    --primary-dark: #12395f;
    --accent: #6a7a89;
    --good: #8a6b22;
    --strong: #174a7c;
    --very-strong: #0f5b8d;
    --shadow: 0 18px 42px rgba(17, 32, 49, 0.08);
    --radius: 18px;
    --font-head: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-weight: 400;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg {
    max-width: 100%;
}

button,
input,
select {
    font: inherit;
}

a,
button,
input,
select,
.passphrase {
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

:focus-visible {
    outline: 3px solid rgba(28, 124, 114, 0.28);
    outline-offset: 2px;
}

.wrap {
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
}

.hero {
    padding: 1.25rem 0 0.65rem;
}

.eyebrow {
    margin: 0 0 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.7rem;
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--primary);
    opacity: 0.88;
}

h1,
h2,
summary,
.button,
.passphrase,
label,
.output-label,
.strength-box span {
    font-family: var(--font-head);
}

h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3.8vw, 2.85rem);
    line-height: 1;
    max-width: none;
    letter-spacing: -0.03em;
}

.subtitle {
    margin: 0.45rem 0 0;
    font-size: clamp(0.88rem, 1.2vw, 1rem);
    color: var(--muted);
    font-weight: 500;
    max-width: none;
}

.intro {
    margin: 0;
    max-width: 60ch;
}

.generator-section {
    padding-bottom: 1.5rem;
}

.card {
    background: var(--surface);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.generator-card {
    padding: 1rem 1.1rem 1.1rem;
}

.card-head h2,
.info-card h2,
.faq h2 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
}

.card-head p,
.info-card p {
    margin: 0;
    color: var(--muted);
}

.controls {
    margin-top: 0.35rem;
    display: grid;
    gap: 0.75rem;
}

.control-group,
.mode-panel {
    border: 0;
    margin: 0;
    padding: 0;
}

.hidden {
    display: none;
}

.mode-switch {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    min-width: 0;
}

.mode-option {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.52rem 0.78rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
    cursor: pointer;
    font-size: 0.94rem;
}

.mode-option input {
    accent-color: var(--primary);
}

.toolbar-row {
    display: flex;
    align-items: center;
    gap: 0.65rem 0.9rem;
    flex-wrap: wrap;
}

.toolbar-row-primary {
    justify-content: space-between;
}

.toolbar-row-secondary {
    gap: 0.75rem;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.control-inline {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.control-inline label {
    margin: 0;
    white-space: nowrap;
}

.control-grow {
    flex: 1 1 220px;
}

.control-select select {
    min-width: 150px;
}

.control-slider {
    flex: 1 1 260px;
    min-width: 260px;
}

.control label,
.output-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text);
}

.range-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 180px;
    flex: 1;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

output {
    min-width: 2rem;
    font-family: var(--font-head);
    font-weight: 700;
    text-align: center;
}

select {
    width: 100%;
    padding: 0.56rem 0.76rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    font-weight: 500;
}

.switch {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.52rem 0.72rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.94rem;
}

.switch input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
}

.output-panel {
    margin-top: 0.25rem;
    padding: 1rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #eef4fb 0%, #e2ebf6 100%);
    border: 1px solid rgba(23, 74, 124, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.passphrase-wrap {
    position: relative;
}

.passphrase {
    min-height: 4.5rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(23, 74, 124, 0.2);
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.02em;
    word-break: break-word;
    box-shadow: 0 8px 24px rgba(20, 36, 51, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.copy-feedback {
    position: absolute;
    top: -0.35rem;
    right: 0.5rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--primary);
    color: white;
    font-size: 0.76rem;
    font-weight: 700;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}

.copy-feedback.visible {
    opacity: 1;
    transform: translateY(0);
}

.output-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
}

.strength-stack {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.strength-box {
    display: flex;
    flex-direction: column;
}

.strength-box span {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.strength-box strong[data-level="Good"] {
    color: var(--good);
}

.strength-box strong[data-level="Strong"] {
    color: var(--strong);
}

.strength-box strong[data-level="Very Strong"] {
    color: var(--very-strong);
}

.strength-box strong {
    color: var(--primary-dark);
}

.button-row {
    display: flex;
    gap: 0.75rem;
}

.button {
    border: 0;
    border-radius: 999px;
    padding: 0.68rem 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    font-size: 0.95rem;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--primary);
    color: white;
}

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

.button-secondary {
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    border: 1px solid var(--border);
}

.info-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-bottom: 0.9rem;
}

.info-card,
.faq {
    padding: 1.05rem 1.1rem;
}

.faq {
    margin-bottom: 3rem;
}

.faq-list {
    display: grid;
    gap: 0.75rem;
}

details {
    padding: 0.95rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.74);
}

summary {
    cursor: pointer;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-size: 0.98rem;
}

details p {
    margin: 0.75rem 0 0;
    color: var(--muted);
    font-weight: 500;
}

@media (min-width: 761px) {
    h1,
    .subtitle {
        white-space: nowrap;
    }
}

@media (max-width: 760px) {
    .hero {
        padding-top: 1rem;
    }

    .toolbar-row,
    .toggle-row,
    .control-inline,
    .info-grid,
    .output-meta {
        grid-template-columns: 1fr;
        display: grid;
    }

    h1 {
        font-size: clamp(1.65rem, 8vw, 2.2rem);
        line-height: 1.05;
        white-space: normal;
    }

    .subtitle {
        font-size: 0.95rem;
        line-height: 1.45;
        white-space: normal;
    }

    .generator-card,
    .info-card,
    .faq {
        border-radius: 16px;
    }

    .toolbar-row {
        gap: 0.7rem;
    }

    .mode-switch,
    .toggle-row {
        width: 100%;
    }

    .mode-option {
        justify-content: center;
    }

    .output-meta,
    .button-row {
        gap: 0.85rem;
    }

    .control-slider,
    .control-grow {
        min-width: 0;
    }

    .control-inline {
        gap: 0.4rem;
    }

    .control-inline label {
        white-space: normal;
    }

    .control-select select,
    .range-row {
        min-width: 0;
    }

    .range-row {
        width: 100%;
    }

    .switch {
        width: 100%;
        justify-content: flex-start;
    }

    .passphrase {
        min-height: 4rem;
        font-size: clamp(1.05rem, 5vw, 1.35rem);
    }

    .strength-stack {
        gap: 0.85rem;
    }

    .button-row {
        grid-template-columns: 1fr 1fr;
    }

    .button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .wrap {
        width: min(100% - 0.9rem, 1100px);
    }

    .hero {
        padding: 0.9rem 0 0.55rem;
    }

    .generator-card,
    .info-card,
    .faq {
        padding: 0.9rem;
    }

    .controls {
        gap: 0.65rem;
    }

    .mode-switch {
        grid-template-columns: 1fr 1fr;
        display: grid;
        gap: 0.55rem;
    }

    .mode-option {
        width: 100%;
        padding: 0.55rem 0.65rem;
    }

    .output-panel {
        padding: 0.85rem;
    }

    .passphrase {
        padding: 0.8rem 0.85rem;
    }

    .copy-feedback {
        right: 0.25rem;
    }

    .button-row {
        grid-template-columns: 1fr;
    }
}
