:root{
    /* Colors */
    --pc-container-background: #24232C;
    --pc-title-color: #817D92;
    --pc-white-text: #E6E5EA;
    --pc-page-background: #18171F;
    --pc-button-green: #A4FFAF;
    --pc-strength-red: #F64A4A;
    --pc-strength-orange: #FB7C58;
    --pc-strength-yellow: #F8CD65;

    /* Fonts */
    font-size: 18px;
    --fs-heading1: 32px;
    --fs-heading2: 24px;
}

@font-face {
    font-family: JetBrainsMonoBold;
    src: url(./assets/fonts/static/JetBrainsMono-Bold.ttf);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: none;
    font-family: JetBrainsMonoBold, sans-serif ;
}

body{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100dvh;
    background-color: var(--pc-page-background);
    color: var(--pc-white-text);
}

main{
    width: min(540px, 90%);
}

.title{
    color: var(--pc-title-color);
    font-size: var(--fs-heading2);
    text-align: center;
    margin-bottom: 1.7rem;
}

.generated-password-container{
    background-color: var(--pc-container-background);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem; 
    margin-bottom: 1.3rem;
}

#generated-password{
    opacity: 0.25;
    font-size: var(--fs-heading1);
}

#copy-button{
    background-color: transparent;
    border: none;
    position: relative;
}

#copy-button img:hover{
    cursor: pointer;
    filter: invert(0%) brightness(2) contrast(80%);
}

#copied-text{
    color: var(--pc-button-green);
    text-transform: uppercase;
    position: absolute;
    right: 150%;
    top: 30%;
    pointer-events: none;
}

.password-details{
    background-color: var(--pc-container-background);
    padding: 2rem 1.7rem 1.7rem;
}

.range-container{
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.7rem;
    position: relative;
}

#current-length{
    position: absolute;
    right: 0;
    bottom: 50%;
    font-size: var(--fs-heading1);
    color: var(--pc-button-green);
}

#password-slider{
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    width: 100%;
    height: 0.5rem;
    background: transparent;

    --progress: 50%;
}

#password-slider::-webkit-slider-thumb{
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--pc-white-text);
    margin-top: -0.5rem;
}

#password-slider::-webkit-slider-thumb:hover{
    background: var(--pc-page-background);
    border: 2px solid var(--pc-button-green);
}

#password-slider::-webkit-slider-runnable-track{
    height: 0.5rem;
    background: linear-gradient(to right, var(--pc-button-green) var(--progress), var(--pc-page-background) var(--progress));
}

#password-slider::-moz-range-thumb {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--pc-white-text);
}

#password-slider::-moz-range-track {
    height: 0.5rem;
    border-radius: 0.25rem;
    background: var(--pc-page-background);
}

#password-slider::-moz-range-progress {
    height: 0.5rem;
    border-radius: 0.25rem;
    background: var(--pc-button-green);
}

.checklist-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.7rem;
}

.checklist-container > label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checklist-container input{
    position: absolute;
    opacity: 0;
}

.checkmark{
    width: 20px;
    height: 20px;
    border: 2px solid var(--pc-white-text);
    display: inline-block;
    position: relative;
    margin-right: 1.7rem;
}

.checklist-container input:checked + .checkmark::before{
    content: "";
    position: absolute;
    left: 0.25rem;
    bottom: 0.2rem;
    width: 5px;
    height: 10px;
    border: solid var(--pc-page-background);
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.checklist-container input:checked + .checkmark{
    background-color: var(--pc-button-green);
    border: 2px solid var(--pc-button-green); 
}

.checklist-container > label:hover .checkmark{
    border: 2px solid var(--pc-button-green); 
}

.strength-container{
    background-color: #18171F90;
    display: flex;
    align-items: center;
    padding: 1.5rem 1.2rem 1.5rem 1.5rem;
    margin-bottom: 1.7rem;
}

.strength-container > h3 {
    text-transform: uppercase;
    color: var(--pc-title-color);
}

#password-strength-text{
    margin-left: auto;
    margin-right: 1rem;
    font-size: var(--fs-heading2);
    text-transform: uppercase;
}

.strength-bars{
    border: 2px solid var(--pc-white-text);
    width: 10px;
    height: 28px;
    margin-right: 0.3rem;
}

.too-weak{
    background-color: var(--pc-strength-red);
    border: 2px solid var(--pc-strength-red);
}

.weak{
    background-color: var(--pc-strength-orange);
    border: 2px solid var(--pc-strength-orange);
}

.medium{
    background-color: var(--pc-strength-yellow);
    border: 2px solid var(--pc-strength-yellow);
}

.strong{
    background-color: var(--pc-button-green);
    border: 2px solid var(--pc-button-green);
}


#generate-button{
    width: 100%;
    color: var(--pc-page-background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    gap: 1.2rem;
    padding: 1rem;
    text-transform: uppercase;
    background-color: var(--pc-button-green);
    border: 2px solid transparent;
}

#generate-button:hover{
    background-color: transparent;
    color: var(--pc-button-green);
    border: 2px solid var(--pc-button-green);
    cursor: pointer;
    
    .button-arrow{
        fill: var(--pc-button-green);
    }
}

.hidden{
    display: none;
}

@media (max-width: 600px) {
    #generated-password{
        font-size: 1rem;
    }

    .range-label, .checklist-container > label, .strength-container > h3 {
        font-size: 0.9rem;
    }

    #current-length{
        font-size: var(--fs-heading2);
    }

    #password-strength-text{
        font-size: 1rem;
        text-align: right;
        margin-right: 0.4rem;
    }
}
