:root {
    color-scheme: light dark;
    --page-text: #f7fbff;
    --muted-text: rgba(255, 255, 255, 0.9);
    --nav-text: #08111b;
    --surface-strong: rgba(235, 247, 255, 0.28);
    --surface-soft: rgba(255, 255, 255, 0.18);
    --surface-border: rgba(255, 255, 255, 0.38);
    --surface-shadow: 0 28px 80px rgba(5, 18, 38, 0.24);
    --glass-blur: blur(16px);
    --primary: #4fd18b;
    --primary-strong: #1f9a62;
    --accent: #2d8cff;
    --accent-deep: #0f4bcc;
    --danger: #ff7f7f;
    --danger-border: #ff4d4d;
    --info: #5ab8ff;
    --info-border: #0d7bff;
    --success: #6fe3a1;
    --success-border: #15a661;
    --button-text: #f7fbff;
    --input-text: #08111b;
    --selection-bg: rgba(77, 166, 255, 0.35);
    --selection-text: #08111b;
    --control-radius: 22px;
}
* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    min-height: 100vh;
    color: var(--page-text);
    font-family: Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(58, 167, 255, 0.38), transparent 32%),
        radial-gradient(circle at 85% 18%, rgba(17, 74, 214, 0.48), transparent 30%),
        radial-gradient(circle at 78% 72%, rgba(55, 199, 127, 0.28), transparent 24%),
        linear-gradient(145deg, #051120 0%, #0b1f44 42%, #123b73 70%, #13515f 100%);
    overflow-x: hidden;
}
.background-glow,
.background-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
}
.background-glow-a {
    background: radial-gradient(circle at 18% 22%, rgba(51, 159, 255, 0.24), transparent 30%);
}
.background-glow-b {
    background: radial-gradient(circle at 82% 68%, rgba(79, 209, 139, 0.18), transparent 28%);
}
.background-grid {
    opacity: 0.18;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.56), transparent 85%);
}
a {
    color: inherit;
    text-decoration: none;
}
nav {
    position: fixed;
    top: 12px;
    left: 5%;
    z-index: 10;
    width: 90%;
    height: 58px;
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    background: rgba(236, 245, 255, 0.36);
    box-shadow: 0 14px 36px rgba(5, 18, 38, 0.18);
    backdrop-filter: var(--glass-blur);
}
nav > ul {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}
nav > ul > li {
    flex: 1;
}
nav > ul > li > a,
nav > ul > li > a:hover {
    display: block;
    padding: 18px 0;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
}
nav > ul > li > a:hover,
nav > ul > li > a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}
main,
.infoRed,
.infoBlue,
.infoGreen {
    position: relative;
    z-index: 1;
}
h1,
h2,
nav > ul > li > a,
nav > ul > li > a:hover {
    margin: 0 0 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted-text);
    letter-spacing: 0.1em;
}
h1 {
    font-size: 1.8rem;
    margin: 0;
}
h2 {
    font-size: 1.2rem;
    padding-bottom: 0.4rem
}
header,
main {
    width: min(980px, calc(100% - 32px));
    margin: 18px auto 0;
    padding-bottom: 48px;
}
header {
    margin: 0 auto;
    padding: 122px 0 26px;
    text-align: center;
}
header p {
    margin: 14px auto 0;
    color: var(--muted-text);
    font-size: 1.03rem;
    line-height: 1.6;
}

.infoRed,
.infoBlue,
.infoGreen {
    width: min(980px, calc(100% - 32px));
    margin: 8px auto;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-left: 6px solid var(--danger-border);
    border-radius: 14px;
    background: rgba(255, 127, 127, 0.18);
    box-shadow: 0 12px 32px rgba(5, 18, 38, 0.16);
    backdrop-filter: var(--glass-blur);
}

.infoRed p,
.infoBlue p,
.infoGreen p {
    margin: 0;
    font-weight: 700;
}
.infoBlue {
    background: rgba(60, 149, 255, 0.2);
    border-left-color: var(--info-border);
}
.infoGreen {
    background: rgba(64, 205, 125, 0.2);
    border-left-color: var(--success-border);
}

section {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border: 1px solid var(--surface-border);
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(240, 248, 255, 0.1)),
        var(--surface-soft);
    box-shadow: var(--surface-shadow);
    backdrop-filter: blur(18px);
}

section::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 27px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 35%, rgba(79, 209, 139, 0.08));
    pointer-events: none;
}

section > * {
    position: relative;
}
.generator-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.password-row {
    margin: 0;
}

.password-output {
    width: 100%;
    padding: 12px 12px;
    min-height: 54px;
    color: var(--input-text);
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: var(--control-radius);
    background: rgba(255, 255, 255, 0.5);
}
.password-output:focus {
    outline: 2px solid rgba(45, 140, 255, 0.55);
    outline-offset: 1px;
}
.actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--control-radius);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}
.action-button:hover {
     opacity: 0.9;
}
.action-button:disabled {
    cursor: wait;
    opacity: 0.75;
    transform: none;
}

.action-button.primary {
    color: var(--button-text);
    background: linear-gradient(135deg, var(--accent), var(--primary));
    box-shadow: 0 16px 28px rgba(21, 89, 177, 0.24);
}

.action-button.secondary {
    color: var(--page-text);
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
}

.status-text {
    margin: 16px 0 0;
    color: var(--muted-text);
    font-size: 0.98rem;
}

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

@font-face {
    font-family: 'Material Icons';
    src: local('Material Icons'), url(material-icons-outlined-euIg.woff2) format('woff2');
    font-display: block;
}
.icons {
    font-family: 'Material Icons' !important;
    font-weight: normal;
    font-style: normal;
    font-size: 1.2rem;
    line-height: 1;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
    -webkit-font-smoothing: antialiased;
}

@media (max-width: 720px) {
    nav {
        width: calc(100% - 24px);
        left: 12px;
    }
    nav > ul > li > a,
    nav > ul > li > a:hover {
        padding: 20px 0 17px;
        font-size: 0.92rem;
        letter-spacing: 0.04em;
    }
    header h1 {
        font-size: 1.4rem;
    }
    section {
        padding: 22px;
        border-radius: 24px;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .pattern-badge {
        min-width: 58px;
        height: 58px;
        border-radius: 18px;
    }
    .actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .action-button {
        aspect-ratio: auto;
        min-height: 54px;
        padding: 0 20px;
    }
}

@media (min-width: 721px) {
    .generator-controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: stretch;
        gap: 14px;
    }
    .actions {
        display: flex;
        width: auto;
    }
    .action-button {
        width: 54px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --page-text: #eef7ff;
        --muted-text: rgba(221, 234, 250, 0.76);
        --nav-text: #eef7ff;
        --surface-soft: rgba(10, 17, 30, 0.38);
        --surface-border: rgba(190, 220, 255, 0.18);
        --surface-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
        --input-text: #f2f8ff;
        --selection-bg: rgba(77, 166, 255, 0.28);
        --selection-text: #f4f9ff;
    }
    body {
        background:
            radial-gradient(circle at top left, rgba(0, 119, 255, 0.28), transparent 30%),
            radial-gradient(circle at 82% 20%, rgba(27, 93, 255, 0.34), transparent 26%),
            radial-gradient(circle at 76% 72%, rgba(24, 138, 78, 0.26), transparent 24%),
            linear-gradient(160deg, #02060d 0%, #071126 36%, #0a214e 68%, #072032 100%);
    }
    nav {
        background: rgba(8, 15, 28, 0.5);
        box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
    }
    .infoRed {
        background: rgba(168, 34, 34, 0.28);
    }
    .infoBlue {
        background: rgba(12, 82, 164, 0.3);
    }
    .infoGreen {
        background: rgba(18, 105, 61, 0.28);
    }
    section {
        background:
            linear-gradient(180deg, rgba(31, 49, 82, 0.34), rgba(10, 20, 36, 0.42)),
            rgba(8, 15, 28, 0.44);
    }
    .password-output {
        background: rgba(7, 15, 28, 0.68);
        border-color: rgba(183, 218, 255, 0.18);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }
    .action-button.secondary {
        background: rgba(255, 255, 255, 0.08);
    }
}
