:root {
    --bg-color: #eeeeee;
    --text-color: #333;
    --accent-color: #fcdd76;
    --accent-hover: #ffeba9;
    --accent-active: #fbce3a;
    --danger-color: #ff4444;
    --success-color: #00C851;
    --font-stack: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --radius: 4px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-stack);
    background: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 20px;
}

.controls-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 30px;
}

.control-group {
    flex: 1;
    min-width: 300px;
}

.group-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.btn, 
.length-options-wrapper span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 20px;
    border: none;
    background: var(--accent-color);
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease, transform 0.1s;
    border-radius: var(--radius);
    margin-right: 8px;
    margin-bottom: 8px;
}

.btn:hover, 
.length-options-wrapper span:hover {
    background: var(--accent-hover);
}

.btn:active, 
.length-options-wrapper span:active,
.length-options-wrapper span.active {
    background: var(--accent-active);
    transform: translateY(1px);
    font-weight: 600;
}

.icon-btn {
    padding: 0 15px;
    font-size: 20px;
}

.length-options-wrapper span {
    width: 44px;
    padding: 0;
    font-weight: 500;
}

.entropy-container {
    margin-top: 15px;
    background: #ddd;
    height: 6px;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.entropy-bar {
    height: 100%;
    width: 0%;
    background: var(--danger-color);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s;
}

.entropy-value {
    position: absolute;
    right: 0;
    top: 8px;
    font-size: 12px;
    color: #888;
}

.password-display input {
    width: 100%;
    border: none;
    background: transparent;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 48px;
    color: var(--text-color);
    outline: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 10px 0;
}

.password-display form {
    width: 100%;
    margin: 0;
    padding: 0;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease-out;
}

.modal-hint {
    margin: 15px 0 20px;
    font-family: monospace;
    color: #555;
}

#qr-code {
    display: block;
    margin: 0 auto;
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 600px) {
    .controls-panel {
        flex-direction: column;
        gap: 20px;
    }
    
    .password-display input {
        font-size: 28px;
        text-align: center;
    }
    
    .buttons-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .btn {
        flex: 1;
        min-width: 120px;
        margin-right: 5px;
    }
    
    .icon-btn {
        min-width: 60px;
        flex: 0;
    }
}

button:focus-visible, 
input:focus-visible {
    outline: 2px solid #333;
    outline-offset: 2px;
}

.options-wrapper {
    display: flex;
    align-items: center;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: #ddd;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: background-color 0.2s;
}

.checkbox-container:hover .checkmark {
    background-color: #ccc;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--accent-active);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid #333;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}