:root {
    --primary-color: #a638f6;
    --background-color: #16111A;
    --container-color: #2D2039;
    --text-color: white;
    --weak-color: red;
    --medium-color: orange;
    --strong-color: #90EE90;
    --font-family: 'Roboto', serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    background-color: var(--background-color);
    font-family: var(--font-family);
    letter-spacing: 0.10em;
}

.main-container {
    width: 500px;
    max-width: 100%;
    margin: auto;
    text-align: center;
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#passwordContainer {
    width: 100%;
    height: 70px;
    background-color: var(--container-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 20px;
}

#passwordBox {
    font-size: 20px; 
    color: var(--text-color); 
    padding: 10px; 
    background-color: var(--container-color); 
    letter-spacing: 0.2em;
}

#copyPassword {
    cursor: pointer;
}

.settings-container {
    width: 100%; 
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background-color: var(--container-color);
    gap: 20px;
    padding: 10px; 
}

#optionsContainer {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: var(--container-color);
    padding: 20px;
    margin-bottom: 20px;
    position: relative; 
    box-sizing: border-box;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-container input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    background-color: var(--background-color);
    border: 1px solid var(--text-color);
    border-radius: 1px;
    position: relative;
    cursor: pointer;
}

.checkbox-container input[type="checkbox"]:checked {
    border: none;
    background-color: var(--primary-color);
    outline: 2px solid var(--primary-color); 
}

.checkbox-container input[type="checkbox"]:checked::before {
    content: '✔';
    display: block;
    color: var(--background-color); 
    text-align: center;
    line-height: 18px;
    font-size: 14px;
}

.checkbox-container input[type="checkbox"]:focus {
    outline: 2px solid var(--primary-color);
}

.checkbox-container label {
    margin: 0;
}

.length-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

#passwordLength {
    width: 100%;
    margin: 0;
    background: transparent;
    position: relative;
    z-index: 2; 
    padding: 0; 
}

#lengthDisplay {
    color: var(--primary-color); 
    font-size: 27px; 
    font-weight: bold; 
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--text-color);
    cursor: pointer;
    border-radius: 50%; 
    margin-top: -6px; 
}

input[type=range]::-moz-range-track {
    width: 100%;
    height: 8px;
    background: transparent;
    border-radius: 0; 
}

input[type=range]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--text-color);
    cursor: pointer;
    border-radius: 50%; 
}

input[type=range]::-ms-track {
    width: 100%;
    height: 8px;
    background: transparent;
    border: none;
    border-radius: 0; 
}

input[type=range]::-ms-thumb {
    width: 20px;
    height: 20px;
    background: var(--text-color);
    cursor: pointer;
    border-radius: 50%; 
}

#passwordStrength {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color);
    padding: 20px;
    width: 90%;
    height: 70px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
}

#passwordStrength label {
    color: var(--background-color); 
}

#strengthDisplay {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
}

#strengthText {
    margin-right: 20px;
}

.bars {
    display: flex;
}

.bar {
    width: 10px;
    height: 40px;
    margin: 0 2px;
    background-color: #ccc;
}

button {
    width: 90%;
    height: 70px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 16px;
    margin: 0 auto 20px auto; 
    transition: background-color 0.3s;
}

button:hover {
    background-color: #8e30d4;
}

button:focus {
    outline: 2px solid #8e30d4;
}

.logo-container {
    align-self: center;
    margin: 20px 0;
}

.logo-container img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .main-container {
        width: 100%;
        padding: 10px;
    }

    #passwordContainer {
        height: auto;
        padding: 10px;
        font-size: 18px;
    }

    #passwordBox {
        font-size: 18px;
    }

    #copyPassword {
        width: 25px;
        height: 25px;
    }

    #optionsContainer {
        padding: 10px;
    }

    #lengthDisplay {
        font-size: 20px;
    }

    #passwordStrength {
        height: auto;
        padding: 10px;
    }

    button {
        height: auto;
        padding: 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .main-container {
        width: 100%;
        padding: 5px;
    }

    #passwordContainer {
        height: auto;
        padding: 5px;
        font-size: 16px;
    }

    #passwordBox {
        font-size: 16px;
    }

    #copyPassword {
        width: 20px;
        height: 20px;
    }

    #optionsContainer {
        padding: 5px;
    }

    #lengthDisplay {
        font-size: 18px;
    }

    #passwordStrength {
        height: auto;
        padding: 5px;
    }

    button {
        height: auto;
        padding: 10px;
        font-size: 12px;
    }
}
