@import "../template.css?v=20260613-shared-hero";

/* Generator Section */
.generator-section {
    padding: 0 20px 80px;
    background: transparent;
    margin: 0 0 60px;
}

.generator-container {
    position: relative;
    max-width: 920px;
    margin: 0 auto;
    background: var(--background-box);
    border: 2px solid transparent;
    border-radius: 24px;
    padding: 50px 40px;
}

.generator-mode-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.generator-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--section-grid-gap);
    margin-bottom: 38px;
}

.generator-mode-card {
    min-height: 145px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    border: 2px solid var(--section-border);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(39, 153, 255, 0.055), transparent 44%),
        var(--section-bg);
    color: var(--hero-title);
    cursor: pointer;
    transition:
        border-color var(--ui-transition),
        background-color var(--ui-transition),
        transform var(--ui-transition);
}

.generator-mode-card:hover,
.generator-mode-card:focus-visible {
    border-color: rgba(39, 153, 255, 0.46);
    outline: none;
}

#generatorModePassword:focus-visible ~ .generator-mode-grid label[for="generatorModePassword"],
#generatorModePassphrase:focus-visible ~ .generator-mode-grid label[for="generatorModePassphrase"] {
    outline: 3px solid rgba(39, 153, 255, 0.4);
    outline-offset: 4px;
}

.generator-mode-icon {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 16px;
    background: rgba(39, 153, 255, 0.12);
    color: var(--brand-blue-circuit);
    font-size: 1.45rem;
}

.generator-mode-copy {
    display: grid;
    gap: 8px;
}

.generator-mode-copy strong {
    font-size: clamp(1.15rem, 1.7vw, 1.45rem);
    font-weight: 800;
    line-height: 1.2;
}

.generator-mode-copy small {
    color: var(--hero-subtitle);
    font-size: 0.95rem;
    line-height: 1.45;
}

#generatorModePassword:checked ~ .generator-mode-grid label[for="generatorModePassword"],
#generatorModePassphrase:checked ~ .generator-mode-grid label[for="generatorModePassphrase"] {
    border-color: var(--brand-blue-circuit);
    background:
        linear-gradient(135deg, rgba(39, 153, 255, 0.16), rgba(30, 30, 226, 0.06)),
        var(--section-bg);
}

#generatorModePassword:checked ~ .generator-mode-grid label[for="generatorModePassword"],
#generatorModePassphrase:checked ~ .generator-mode-grid label[for="generatorModePassphrase"] {
    border-color: var(--brand-sapphire);
}

.generator-panel {
    display: none;
}

#generatorModePassword:checked ~ .generator-panels .generator-panel-password,
#generatorModePassphrase:checked ~ .generator-panels .generator-panel-passphrase {
    display: block;
}

/* Password Output */
.password-result {
    flex: 1 1 auto;
    min-width: 0;
}

.password-output-wrapper {
    position: relative;
    display: flex;
    height: 54px;
    min-width: 0;
}

#password-output,
#passphrase-output {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: var(--section-bg);
    border: 2px solid var(--section-border);
    border-radius: 16px;
    padding: 0 18px;
    font-family: 'Chakra Petch', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 54px;
    color: var(--hero-title);
    transition: all 0.3s ease;
    user-select: all;
    cursor: pointer;
}

#password-output:focus,
#passphrase-output:focus {
    outline: none;
    border-color: var(--brand-sapphire);
    background: var(--background-box);
}

body.dark-theme #password-output:focus,
body.dark-theme #passphrase-output:focus {
    border-color: var(--brand-blue-circuit);
}

.generator-copy-status {
    min-height: 22px;
    margin: 8px 0 0;
    color: var(--brand-green);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
}

.generator-copy-status.is-error {
    color: var(--brand-error-mid);
}

/* Control Sections */
.control-section {
    margin-bottom: 35px;
}

.control-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--hero-title);
    margin-bottom: 15px;
}

.control-label i {
    color: var(--brand-sapphire);
    font-size: 1.2rem;
}

body.dark-theme .control-label i {
    color: var(--brand-blue-circuit);
}

/* Length Control */
.length-control {
    display: flex;
    align-items: center;
    gap: 20px;
}

#password-length {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right,
    var(--brand-error) 0%,
    var(--brand-warning) 25%,
    var(--brand-warning-mid) 50%,
    var(--brand-green) 75%,
    var(--brand-green) 100%
    );
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

#passphrase-word-count {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--brand-blue-circuit), var(--brand-green));
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

#password-length::-webkit-slider-thumb,
#passphrase-word-count::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: white;
    border: 3px solid var(--brand-sapphire);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.dark-theme #password-length::-webkit-slider-thumb,
body.dark-theme #passphrase-word-count::-webkit-slider-thumb {
    border-color: var(--brand-blue-circuit);
}

#password-length::-moz-range-thumb,
#passphrase-word-count::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: white;
    border: 3px solid var(--brand-sapphire);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.dark-theme #password-length::-moz-range-thumb,
body.dark-theme #passphrase-word-count::-moz-range-thumb {
    border-color: var(--brand-blue-circuit);
}

#display-password-length,
#display-passphrase-word-count {
    width: 70px;
    background: rgba(33, 216, 89, 0.08);
    border: 2px solid var(--brand-green);
    border-radius: var(--ui-radius-button);
    padding: 12px;
    text-align: center;
    font-family: 'Chakra Petch', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-green);
    transition: all 0.3s ease;
}

body.dark-theme #display-password-length,
body.dark-theme #display-passphrase-word-count {
    background: rgba(33, 216, 89, 0.18);
    color: var(--brand-green-pale);
    border-color: var(--brand-green);
}

#display-password-length:focus,
#display-passphrase-word-count:focus {
    outline: none;
    border-color: var(--brand-green);
}

body.dark-theme #display-password-length:focus,
body.dark-theme #display-passphrase-word-count:focus {
    border-color: var(--brand-green);
}

.generator-select {
    width: 100%;
    min-height: 52px;
    border: 2px solid var(--section-border);
    border-radius: 14px;
    background: var(--section-bg);
    color: var(--hero-title);
    padding: 0 16px;
    font-weight: 700;
    transition: border-color var(--ui-transition);
}

.generator-select:focus {
    border-color: var(--brand-blue-circuit);
    outline: none;
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.checkbox-item {
    background: var(--section-bg);
    border: 2px solid var(--section-border);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.checkbox-item:hover {
    border-color: #cbd5e1;
}

body.dark-theme .checkbox-item:hover {
    border-color: #3a3a3a;
}

.checkbox-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--brand-sapphire);
}

body.dark-theme .checkbox-item input[type="checkbox"] {
    accent-color: var(--brand-blue-circuit);
}

.checkbox-label {
    font-family: 'Chakra Petch', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--hero-title);
    min-width: 45px;
}

.checkbox-desc {
    font-size: 0.9rem;
    color: var(--hero-subtitle);
}

.checkbox-item input[type="checkbox"]:checked ~ .checkbox-label {
    color: var(--brand-sapphire);
}

body.dark-theme .checkbox-item input[type="checkbox"]:checked ~ .checkbox-label {
    color: var(--brand-blue-circuit);
}

.checkbox-item:has(input[type="checkbox"]:checked) {
    background: linear-gradient(135deg, rgba(30, 30, 226, 0.05) 0%, transparent 100%);
    border-color: var(--brand-sapphire);
}

body.dark-theme .checkbox-item:has(input[type="checkbox"]:checked) {
    background: linear-gradient(135deg, rgba(39, 153, 255, 0.1) 0%, transparent 100%);
    border-color: var(--brand-blue-circuit);
}

.generator-action {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-height: 54px;
    margin-top: 40px;
}

/* Generate Button */
.generate-button {
    box-sizing: border-box;
    width: 170px;
    height: 54px;
    min-height: 0;
    flex: 0 0 170px;
    background: var(--brand-sapphire);
    color: white;
    border: 2px solid transparent;
    border-radius: var(--ui-radius-button);
    padding: 0 22px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--ui-transition), transform var(--ui-transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0;
}

@media (min-width: 769px) {
    .generate-button {
        white-space: nowrap;
    }
}

.generate-button i {
    font-size: 1.15rem;
}

.generate-button:hover {
    background: var(--brand-blue-circuit);
}

.generate-button:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .generator-container {
        padding: 35px 25px;
    }

    .generator-mode-grid {
        grid-template-columns: 1fr;
    }

    .generator-mode-card {
        min-height: auto;
    }

    .generator-action {
        flex-direction: column;
        margin-top: 32px;
    }

    .password-output-wrapper {
        height: 52px;
    }

    #password-output,
    #passphrase-output {
        height: 52px;
        font-size: 1rem;
        line-height: 52px;
        padding: 0 18px;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .length-control {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    #display-password-length,
    #display-passphrase-word-count {
        width: 100%;
    }

    .generate-button {
        width: 100%;
        height: 52px;
        flex-basis: auto;
        font-size: 1rem;
        padding: 0 24px;
    }
}
