/* Root Styles */
:root {
    --grey-200: #E6E5EA;
    --grey-600: #817D92;
    --grey-700: #54535B;
    --grey-800: #24232C;
    --grey-850: #18171F;
    --grey-900: #14131B;
    --grey-950: #08070B;
    --green-200: #A4FFAF;
    --yellow-300: #F8CD65;
    --orange-400: #FB7C58;
    --red-500: #F64A4A;

    --gradient-1: linear-gradient(to right, var(--grey-900), var(--grey-950));

    --spacing-100: 8px;
    --spacing-200: 16px;
    --spacing-300: 24px;
    --spacing-400: 32px;
    --spacing-500: 40px;
    --spacing-700: 56px;
    --spacing-1000: 80px;
    --spacing-1300: 104px;
    --spacing-1600: 128px;
    --spacing-2000: 160px;
    --spacing-2200: 176px;
    --spacing-2300: 184px;
}

/* General Styles */
body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-200);
    font-family: 'JetBrains Mono', sans-serif;
    font-size: 16px;
    line-height: 20px;
    background: var(--gradient-1);
    padding: var(--spacing-500) var(--spacing-200);
    box-sizing: border-box;
}

h1 {
    font-size: inherit;
    line-height: inherit;
    color: var(--grey-600);
    margin: 0;
}

label, p {
    margin: 0;
}

label {
    color: var(--grey-200);
    font-weight: bold;
}

/* Main Section Styles */
main {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-200);
    width: 100%;
    max-width: 540px;
}

main > div, form {
    background-color: var(--grey-800);
    padding: var(--spacing-200);
}

/* Result Section Styles */
#result-div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-200);
}

#password {
    box-sizing: border-box;
    flex-grow: 1;
    min-width: 0;
    background-color: transparent;
    border: none;
    font-size: 24px;
    line-height: 32px;
    font-weight: bold;
    font-family: inherit;
    color: var(--grey-200);
}

#password::placeholder {
    color: var(--grey-700);
}

#password:focus {
    outline: none;
}

#result-div > div {
    display: flex;
    gap: var(--spacing-200);
    align-items: center;
}

#copied-text {
    opacity: 0;
    transform: scale(0.8);
    visibility: hidden;
    color: var(--green-200);
    font-size: 16px;
    line-height: 20px;
    font-weight: bold;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#copied-text.show {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
}

#result-div svg {
    fill: var(--green-200);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

#result-div svg:hover {
    fill: white;
    cursor: pointer;
    transform: scale(110%);
}

/* Form Section Styles */
form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-400);
}

form > div:last-of-type {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-200);
}

/* Length Div Styles */
#length-div {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-200);
}

.label-div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-right: var(--spacing-200);
}

#length-text {
    color: var(--green-200);
    font-size: 24px;
    line-height: 32px;
    font-weight: bold;
}

#length {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
}

#length::-webkit-slider-runnable-track {
    background: var(--grey-850);
    height: 8px;
}

#length::-moz-range-track {
    background: var(--grey-850);
    height: 8px;
}

#length::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -11px;
    background-color: var(--grey-200);
    height: 28px;
    width: 28px;
    border-radius: 100%;
    transition: background-color 0.3s ease;
}

#length::-webkit-slider-thumb:hover {
    background-color: var(--grey-850);
    border: 2px solid var(--green-200);
}

#length::-moz-range-thumb {
    border: none;
    background-color: var(--grey-200);
    height: 28px;
    width: 28px;
    border-radius: 100%;
    transition: background-color 0.3s ease;
}

#length::-moz-range-thumb:hover {
    background-color: var(--grey-850);
    border: 2px solid var(--green-200);
}

#length:focus::-webkit-slider-thumb {
    background-color: var(--grey-850);
    border: 2px solid var(--green-200);
}

#length:focus::-moz-range-thumb {
    background-color: var(--grey-850);
    border: 2px solid var(--green-200);
}

#length::-moz-range-progress {
    background: var(--green-200);
    height: 8px;
}

/* Choices Div Styles */
#choices-div {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-200);
}

#choices-div > div {
    display: flex;
    align-items: center;
    gap: var(--spacing-200);
}

#choices-div input {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--grey-200);
    cursor: pointer;
    position: relative;
    margin: 0;
    transition: border 0.1s ease;
}

#choices-div input:hover {
    border: 2px solid var(--green-200);
}

#choices-div input:checked {
    background: var(--green-200);
    border: none;
}

#choices-div input:checked::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 12px;
    background: url("images/icon-check.svg") center/contain no-repeat;
    left: 3px;
    top: 4.5px;
}

/* Strength Div Styles */
#strength-div {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--grey-850);
}

#strength-div > p {
    color: var(--grey-600);
    font-weight: bold;
}

#strength-div > div {
    display: flex;
    gap: var(--spacing-200);
    align-items: center;
}

#strength-text {
    font-size: 18px;
    line-height: 24px;
    font-weight: bold;
    color: var(--grey-200);
}

#strength-grid {
    height: 28px;
    display: grid;
    grid-template-columns: 10px 10px 10px 10px;
    column-gap: var(--spacing-100);
}

.strength-bar {
    border: 2px solid var(--grey-200);
}

.red-bar {
    background-color: var(--red-500);
    border: none;
}

.orange-bar {
    background-color: var(--orange-400);
    border: none;
}

.yellow-bar {
    background-color: var(--yellow-300);
    border: none;
}

.green-bar {
    background-color: var(--green-200);
    border: none;
}

/* Generate Button Styles */
#generate-btn {
    background-color: var(--green-200);
    height: 56px;
    font-size: inherit;
    font-family: inherit;
    line-height: inherit;
    font-weight: bold;
    border: none;
    transition: 0.3s background-color ease, 0.3s color ease;
}

#generate-btn:hover {
    background-color: transparent;
    border: 2px solid var(--green-200);
    color: var(--green-200);
    cursor: pointer;
}

#generate-btn svg {
    margin-left: 8px;
    transition: 0.3s fill ease;
}

#generate-btn:hover svg {
    fill: var(--green-200);
}

/* Tablet Responsive Styles */
@media screen and (min-width: 768px) {
    body {
        gap: var(--spacing-400);
    }

    h1 {
        font-size: 24px;
        line-height: 32px;
    }

    label {
        font-size: 18px;
        line-height: 24px;
    }

    main {
        gap: var(--spacing-300);
    }

    #result-div {
        padding: var(--spacing-200) var(--spacing-400);
    }

    #password {
        font-size: 32px;
        line-height: 42px;
    }

    #copied-text {
        font-size: 18px;
        line-height: 24px;
    }

    #result-div svg {
        height: 24px;
    }

    form {
        padding: var(--spacing-300) var(--spacing-400) var(--spacing-500);
    }

    form > div:last-of-type {
        gap: var(--spacing-400);
    }

    #length-div {
        gap: var(--spacing-300);
    }

    .label-div {
        margin-right: 0;
    }

    #length-text {
        font-size: 32px;
        line-height: 42px;
    }

    #choices-div > div {
        gap: var(--spacing-300);
    }

    #strength-div {
        padding: 24px 32px;
        height: 32px;
    }

    #strength-div > p {
        font-size: 18px;
        line-height: 24px;
    }

    #strength-text {
        font-size: 24px;
        line-height: 32px;
    }

    #generate-btn {
        height: 65px;
        font-size: 18px;
        line-height: 24px;
    }
}