/*
 * Password Generator
 * Author: Thomas Brown
 * Website: https://thomasbrown.app
 */

:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    --ink: #19352a;
    --muted: #52675c;
    --paper: #f6f8f4;
    --line: #d9e3d8;
    --green: #285c42;
    --focus: #bc571d;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-width: 0;
    margin: 0;
    background: #edf2eb;
    color: var(--ink);
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.container {
    width: min(100% - 48px, 1160px);
    margin-inline: auto;
}

.skip-link {
    position: fixed;
    z-index: 20;
    top: 12px;
    left: 12px;
    transform: translateY(-160%);
    padding: 10px 16px;
    border-radius: 8px;
    background: #fff;
    color: #173b2b;
    font-weight: 700;
    box-shadow: 0 4px 18px #102c2340;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    background: #193a2d;
    color: #fff;
}

.header-inner,
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-inner {
    min-height: 76px;
}

.site-name {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.site-header a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid #c9e2cf;
    color: #f1fff4;
    font-size: .91rem;
    font-weight: 700;
    text-decoration: none;
}

.site-header a:hover {
    color: #d5f0db;
}

.site-header a:focus-visible {
    outline-color: #ffd681;
}

main {
    padding-block: 54px 80px;
}

.intro {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    overflow: hidden;
    margin-bottom: 28px;
    padding: clamp(30px, 5vw, 58px);
    border: 1px solid #b9d1bf;
    border-radius: 24px;
    background: radial-gradient(circle at 85% 22%, #cee5d0 0, transparent 33%), linear-gradient(125deg, #f9fbf5, #e5f0e6);
}

.intro > div:first-child {
    position: relative;
    z-index: 1;
    max-width: 690px;
}

.eyebrow {
    margin: 0 0 12px;
    color: #315f43;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.15;
    letter-spacing: -.035em;
}

h1 {
    max-width: 650px;
    margin-bottom: 17px;
    font-size: clamp(2.4rem, 5vw, 4.1rem);
}

.lead {
    max-width: 600px;
    margin-bottom: 0;
    color: #405c4c;
    font-size: clamp(1rem, 1.6vw, 1.17rem);
    line-height: 1.65;
}

.intro-symbol {
    position: relative;
    flex: 0 0 225px;
    height: 204px;
}

.intro-symbol span {
    position: absolute;
    display: grid;
    place-items: center;
    width: 160px;
    height: 132px;
    border-radius: 23px;
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: .14em;
    line-height: 1;
    box-shadow: 0 12px 28px #183b2a21;
}

.intro-symbol span:first-child {
    top: 0;
    right: 0;
    transform: rotate(11deg);
    background: #254d37;
    color: #fff;
}

.intro-symbol span:last-child {
    bottom: 0;
    left: 0;
    transform: rotate(-11deg);
    border: 1px solid #a9c6ac;
    background: #f9fcf5;
    color: #254d37;
}

.generator-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}

.panel {
    min-width: 0;
    padding: clamp(23px, 3vw, 36px);
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 30px #173a2509;
}

.panel-heading {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5ebe2;
}

h2 {
    margin-bottom: 10px;
    font-size: clamp(1.7rem, 2.5vw, 2.1rem);
}

.panel-heading > p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    font-size: .94rem;
}

.no-script {
    margin: 0 0 22px;
    padding: 12px 14px;
    border: 1px solid #e8bea8;
    border-radius: 9px;
    background: #fff1e9;
    color: #823719;
    font-size: .88rem;
    font-weight: 700;
}

.format-options {
    min-width: 0;
    margin: 0 0 27px;
    padding: 0 0 26px;
    border: 0;
    border-bottom: 1px solid #e5ebe2;
}

.format-options legend {
    padding: 0;
    color: #284633;
    font-size: .94rem;
    font-weight: 800;
}

.format-options > .field-help {
    margin: 3px 0 15px;
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.format-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    min-height: 91px;
    padding: 14px 12px;
    border: 1px solid #d8e4d8;
    border-radius: 11px;
    background: #f8faf7;
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.format-card:hover {
    border-color: #9ec2a6;
    background: #f2f8f0;
}

.format-card:has(input:checked) {
    border-color: #71a27b;
    background: #eaf4e9;
    box-shadow: inset 0 0 0 1px #71a27b;
}

.format-card:has(input:focus-visible) {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.format-card input {
    flex: none;
    width: 19px;
    height: 19px;
    margin: 1px 0 0;
    accent-color: var(--green);
    cursor: pointer;
}

.format-card input:focus-visible {
    outline: none;
}

.format-card strong,
.format-card small {
    display: block;
}

.format-card strong {
    color: #243d2c;
    font-size: .88rem;
    line-height: 1.3;
}

.format-card small {
    margin-top: 4px;
    color: #53685a;
    font-size: .76rem;
    line-height: 1.4;
}

.apple-settings {
    margin-bottom: 27px;
    padding: 18px 20px;
    border: 1px solid #c5dac7;
    border-radius: 11px;
    background: linear-gradient(135deg, #eef6ec, #f8fbf5);
    color: #435c4b;
    font-size: .87rem;
    line-height: 1.55;
}

.apple-settings p {
    margin-bottom: 10px;
}

.apple-settings p:last-child {
    margin-bottom: 0;
}

.apple-settings strong {
    color: #244d36;
}

.length-control {
    margin-bottom: 29px;
}

.length-control label,
.character-options legend,
.password-label {
    display: block;
    margin-bottom: 13px;
    color: #284633;
    font-size: .94rem;
    font-weight: 800;
}

.length-control label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.length-control output {
    display: inline-grid;
    flex: none;
    place-items: center;
    min-width: 48px;
    padding: 4px 9px;
    border: 1px solid #b7d0ba;
    border-radius: 8px;
    background: #eaf4e9;
    color: #1f4e34;
    font-size: 1.03rem;
    font-variant-numeric: tabular-nums;
}

input[type="range"] {
    display: block;
    width: 100%;
    height: 34px;
    margin: 0;
    border-radius: 999px;
    background: transparent;
    accent-color: var(--green);
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: #dce9db;
}

input[type="range"]::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: #dce9db;
}

input[type="range"]::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
    margin-top: -7px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 2px var(--green);
    appearance: none;
}

input[type="range"]::-moz-range-thumb {
    width: 17px;
    height: 17px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 2px var(--green);
}

input[type="range"] {
    appearance: none;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #53685b;
    font-size: .76rem;
    font-weight: 700;
}

.field-help,
.field-error {
    margin: 8px 0 0;
    font-size: .79rem;
    line-height: 1.45;
}

.field-help {
    color: #53685b;
}

.field-error {
    color: #8c291e;
    font-weight: 700;
}

.character-options {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.character-options legend {
    padding: 0;
}

.character-options > .field-help {
    margin: -5px 0 17px;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 72px;
    padding: 12px;
    border: 1px solid #d8e4d8;
    border-radius: 11px;
    background: #f8faf7;
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease;
}

.option-card:hover,
.option-card:has(input:checked) {
    border-color: #9ec2a6;
    background: #eef6ed;
}

.option-card:has(input:focus-visible) {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.option-card input {
    flex: none;
    width: 19px;
    height: 19px;
    margin: 0;
    accent-color: var(--green);
    cursor: pointer;
}

.option-card input:focus-visible {
    outline: none;
}

.option-card strong,
.option-card small {
    display: block;
}

.option-card strong {
    color: #243d2c;
    font-size: .88rem;
    line-height: 1.25;
}

.option-card small {
    margin-top: 3px;
    color: #53685a;
    font-size: .76rem;
}

.selection-summary {
    margin: 27px 0 14px;
    padding-top: 21px;
    border-top: 1px solid #e5ebe2;
    color: #435c4b;
    font-size: .84rem;
    font-weight: 700;
}

.setting-caution {
    margin: 0 0 14px;
    padding: 11px 13px;
    border: 1px solid #e5b975;
    border-radius: 8px;
    background: #fff5e7;
    color: #70400b;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.45;
}

.primary-button,
.copy-button,
.reveal-button {
    min-height: 48px;
    border-radius: 9px;
    font-weight: 800;
    transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.primary-button,
.copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 11px 17px;
    border: 1px solid #234c37;
    background: var(--green);
    color: #fff;
}

.primary-button:hover:not(:disabled),
.copy-button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: #1d4933;
}

.primary-button span {
    font-size: 1.17em;
    line-height: 1;
}

.password-label {
    margin-bottom: 9px;
}

.password-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
    border: 1px solid #aabdad;
    border-radius: 10px;
    background: #f8faf7;
}

.password-field:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px #285c4221;
}

#password-output {
    display: block;
    min-width: 0;
    width: 100%;
    min-height: 58px;
    padding: 14px 16px;
    overflow: hidden;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.07rem;
    font-weight: 700;
    letter-spacing: .035em;
    text-overflow: ellipsis;
}

#password-output::placeholder {
    color: #586b5b;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: .87rem;
    font-weight: 500;
    letter-spacing: 0;
}

#password-output:focus-visible {
    outline-offset: -4px;
}

.reveal-button {
    align-self: stretch;
    min-height: 0;
    margin: 6px;
    padding: 5px 12px;
    border: 1px solid #b9cdbb;
    background: #fff;
    color: #245039;
    font-size: .78rem;
    white-space: nowrap;
}

.reveal-button:hover:not(:disabled) {
    border-color: #769e7e;
    background: #eaf4e9;
}

.copy-button {
    justify-content: center;
    margin-top: 13px;
}

button:disabled {
    border-color: #c7d1c7;
    background: #e6eae4;
    color: #627267;
    cursor: not-allowed;
    transform: none;
}

.status-message,
.copy-status {
    min-height: 1.4em;
    margin: 13px 0 0;
    color: #4c6253;
    font-size: .82rem;
    line-height: 1.45;
}

.copy-status {
    margin-top: 4px;
    color: #236040;
    font-weight: 700;
}

.status-message.is-error,
.copy-status.is-error {
    color: #8c291e;
    font-weight: 700;
}

.privacy-note {
    margin-top: 32px;
    padding: 22px 23px;
    border: 1px solid #c5dac7;
    border-radius: 13px;
    background: linear-gradient(135deg, #eaf4e9, #f6f9f2);
}

.privacy-note h3 {
    margin-bottom: 8px;
    color: #234b35;
    font-size: 1.03rem;
}

.privacy-note p {
    margin-bottom: 0;
    color: #435e4b;
    font-size: .86rem;
    line-height: 1.6;
}

.site-footer {
    border-top: 1px solid #d5e2d4;
    color: #52675c;
    font-size: .82rem;
}

.footer-inner {
    min-height: 78px;
}

@media (max-width: 820px) {
    .generator-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .intro-symbol {
        flex-basis: 180px;
        height: 164px;
    }

    .intro-symbol span {
        width: 130px;
        height: 108px;
        font-size: 1.9rem;
    }
}

@media (max-width: 600px) {
    .container {
        width: min(100% - 32px, 1160px);
    }

    .header-inner {
        min-height: 68px;
    }

    main {
        padding-block: 24px 50px;
    }

    .intro {
        min-height: 0;
        padding: 27px;
    }

    .intro-symbol {
        display: none;
    }

    h1 {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .panel {
        padding: 24px;
    }

    .format-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .format-card {
        min-height: 0;
    }

    .password-field {
        grid-template-columns: minmax(0, 1fr);
    }

    .reveal-button {
        min-height: 42px;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
        padding-block: 20px;
    }
}

@media (max-width: 390px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 8px 16px;
        padding-block: 12px;
    }

    .site-name {
        font-size: .93rem;
    }

    .site-header a {
        font-size: .78rem;
    }

    .intro,
    .panel {
        padding: 21px;
    }

    .option-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .privacy-note {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
