@import 'tokens.css';

html {
	height: 100%;
	font-size: 62.5%;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::-webkit-scrollbar {
    display: none;
}

::selection {
    color: var(--primary-10);
    background: var(--primary-50);
}

a {
    display: block;
    text-decoration: none;
}

/* SECTIONING
================================================================= */
body {
    height: 100%;
	position: fixed;
    background: var(--neutral-5);
}

.main-header {
    padding: 12px 14px 12px 16px;
    z-index: 5;
}

#empty-state p {
    text-align: center;
}

.empty-state__title {
    font-size: 2.4rem;
    line-height: 2.6rem;
    font-weight: 500;
    /* @media (max-width: 720px) {
        font-size: 2.6rem;
        line-height: 2.8rem;
    } */
}

.empty-state__title + p {
    @media (max-width: 720px) {
        font-size: 1.8rem;
        line-height: 2rem;
    }
}

/* MAIN CONTENT
================================================================= */
main {
    width: 100%;
    max-width: 425px;
}

.bg-cont {
    place-content: center;
}

#background {
    width: 106%;
    font-size: 2.4rem;
    line-height: 3rem;
    font-weight: 600;
    letter-spacing: 0.2rem;
    overflow-wrap: break-word;
    -webkit-user-select: none;
    user-select: none;
}

.password-cont {
    width: 100%;
    font-family: var(--ff-c);
    font-size: 94px;
}

.password {
    text-align: left;
    letter-spacing: 0.16rem;
    font-size: 1.6rem;
}

#crack-time {
    text-shadow: 0 0 20px var(--primary-50);
}

.command {
    height: var(--s-9x);
    width: var(--s-9x);
}

/* MODALS
================================================================= */
#modal-blur {
    top: 0;
    z-index: 3;
}

#modal-blur.active {
    background: var(--neutral-5_90);
    -webkit-backdrop-filter: blur(var(--s-2x));
    backdrop-filter: blur(var(--s-2x));
    z-index: 8;
}

.modal-cont {
    display: flex;
    visibility: hidden;
    opacity: 0;
    top: 0;
}

.modal-cont.active {
    visibility: visible;
    opacity: 1;
}

.modal {
    width: 288px;
}

.modal-title, .password-strength {
    font-weight: 500;
}

.input-wrapper--h {
    width: 100%;
    display: flex;
    gap: var(--s-2x);
}

.input--v {
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: var(--s-x);
    flex: 1;
}

.input-wrapper--v {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--s-3x);
}

.input--h {
    display: flex;
    align-items: center;
    gap: var(--s-2x);

    & > * {
        flex: 1;
    }

    label {
        padding-right: 0;
    }

    div {
        display: flex;
        align-items: center;
        gap: var(--s-2x);

        & > * {
            flex-basis: 0;
        }

        input {
            flex-grow: 1;
        }

        span {
            flex-grow: 0.2;
        }
    }
}

label {
    -webkit-user-select: none;
    user-select: none;
}

/* BUTTONS
================================================================= */
.btn-cont-v {
    width: 100%;
    max-width: 400px;
}

button {
    font-family: var(--f-fam--p);
    border-style: none;
}

.primary-btn:hover {
    background: var(--primary-70);
}

.primary-btn:active {
    background: var(--primary-40);
}

.secondary-btn:hover {
    outline: 1px solid var(--primary-50_40);
}

.secondary-btn:active {
    background: var(--primary-20);
}

#gen-btn {
    rotate: 0deg;

    &.turned {
        rotate: 180deg;
    }
}

/* CHECKBOXES
================================================================= */
.checkbox-frames-cont {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.checkbox-frames-cont * {
    cursor: pointer;
}

.checkbox-frame {
    height: 68px;
    border: var(--primary-50_10) 1px solid;
    -webkit-border-radius: var(--s-2x);
    -moz-border-radius: var(--s-2x);
    -ms-border-radius: var(--s-2x);
    -o-border-radius: var(--s-2x);
    border-radius: var(--s-2x);
    font-size: 1.4rem;
}

.checkbox-frame:hover {
	border: var(--primary-50_40) 1px solid;
}

label:has(input[type="checkbox"]:checked) {
    border: #0FFA 1px solid;
}

label span {
    font-family: var(--ff-c);
    font-size: 2.4rem;
    font-weight: 500;
    line-height: 2.8rem;
}

input[type="checkbox"] {
    display: none;
}

.fake-check {
    height: var(--s-4x);
    width: var(--s-4x);
    top: 8px;
    right: 8px;
}

input[type="checkbox"]:checked ~ .fake-check {
    background-color: var(--primary-50);
    background-image: url(./assets/svg/check.svg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 12px;
}

/* RANGES
================================================================= */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;

    padding: 0;
    overflow: hidden;
}

/* Track */
input[type="range"]::-webkit-slider-runnable-track,
input[type="range"]::-moz-range-track {
    -ms-progress-appearance: none;
    -webkit-appearance: none;
    appearance: none;

    outline: none;
    position: relative;
}

input[type=range]::-ms-track {
    width: 100%;

    /* Hide the slider so custom styles can be added */
    background: transparent;
    border-color: transparent;
    color: transparent;
}

/* Progress */
input[type="range"]::-moz-range-progress {
    height: 100%;
    background-color: var(--primary-50);
    outline: 16px solid var(--primary-50);
    outline-offset: -16px;
}

/* input[type="range"]::-ms-fill-lower {
    height: 100%;
    background-color: var(--primary-50);
    outline: 16px solid var(--primary-50);
    outline-offset: -16px;
} */

/* Thumb */  
input[type="range"]::-moz-range-thumb {
    -moz-appearance: none;
    appearance: none;

    height: 100%;
    width: 0;
    /* width: 24px;
    background-color: var(--primary-50); */
    background-color: transparent;
    border: none;

    -moz-border-radius: 7px;
    border-radius: 7px;

    -moz-transition: all ease-out .2s;
    transition: all ease-out .2s;
}

/* input[type="range"]:active::-moz-range-thumb {
    background: var(--primary-40);
} */

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;

    height: 40px;
    width: 28px;
    margin-top: 0; /* Specify a margin in Chrome. In Firefox and IE it is automatic */
    background: var(--primary-50);
    /* background-color: transparent; */

    -webkit-border-radius: 7px;
    border-radius: 7px;

    -webkit-transition: all ease-out .2s;
    transition: all ease-out .2s;
}

input[type="range"]:active::-webkit-slider-thumb {
    background: var(--primary-40);
}

input[type=range]::-ms-thumb {
    -ms-progress-appearance: none;
    
    height: 40px;
    width: 28px;
    margin-top: 0; /* Specify a margin in Chrome. In Firefox and IE it is automatic */
    background: var(--primary-50);

    -ms-border-radius: 7px;
    border-radius: 7px;

    -ms-transition: all ease-out .2s;
    transition: all ease-out .2s;
}

input[type="range"]:active::-ms-thumb {
    background: var(--primary-40);
}

.display {
    text-align: right;
    flex: 0;
    flex-grow: 0.2;
}

/* FAKE SELECT
================================================================= */
details {
    -webkit-user-select: none;
    user-select: none;
}

details[open] {
	z-index: 1;
}

/* HEADER */
summary {
	list-style: none;
    border-style: none;
}

summary::-webkit-details-marker {
	display: none;
}

summary.radios:before {
	content: var(--selection);
}

input[type=radio] {
	appearance: none;
}

input[type=radio]:after {
	content: attr(value);
	display: block;
    line-height: var(--s-10x);
    font-family: 'DM Sans';
	font-size: 16px;
    color: var(--primary-95);
    text-align: center;
}

details[open] summary i {
    -webkit-transform: rotate(180deg);
	-moz-transform: rotate(180deg);
	-ms-transform: rotate(180deg);
	-o-transform: rotate(180deg);
	transform: rotate(180deg);
}

/* OPTIONS LIST */
ul.list {
    bottom: calc(100% + var(--s-x));
    max-height: 216px;
    overflow-y: auto;
}

ul.list li {
    list-style: none;
    /* line-height: 40px; */
}

.fake-opt:checked {
    background: var(--primary-20);
}

/* ICONS
================================================================= */
i {
    height: 20px;
    width: 20px;
}

i.chevron-down {
    background-image: url(./assets/svg/chevron-down.svg);
    background-size: contain;
}

/* TEXTS
================================================================= */
.uppercase {
    color: #0F0;
}

.lowercase {
    color: #FF0;
}

.number {
    color: #0FF;
}

.special {
    color: #F0F;
}

/* TOASTS
================================================================= */
#toasts-cont {
    width: calc(100% - 32px);
    max-width: 400px;
    top: 72px;
}

.toast {
    animation: open .3s var(--bez);
}

.toast__countdown {
    height: 4px;
    width: 100%;
    position: absolute;
    left: 0;
    bottom: 0;
    background: currentColor;
    animation-name: countdown;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards;
}

.toast.fade {
    animation: fade .3s ease-out forwards;
}

.toast.close {
    animation: close 3s var(--bez) forwards;
}

.toast-success {
    background-color: #005222;
    color: #0c0;
}

.toast-warning {
    background-color: #5f4400;
    color: #ea0;
}

.toast-error {
    background-color: #661414;
    color: #f33;
}

.toast__description {
    color: var(--neutral-95);
}

.toast__text-cont {
    width: fit-content;
}

.toast__btn {
    color: currentColor;
    background: transparent;
}

/* ANIMATIONS
================================================================= */
/* Toasts */
@keyframes open {
    0% {
      transform: translateY(-100%);
      opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fade {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes close {
    0% {
        height: auto;
    }
    100% {
        height: 0;
    }
}

@keyframes countdown {
    0% {
        width: 100%;
    }
    100% {
        width: 0;
    }
}

@media (min-width: 410px) {
    .password {
        font-size: 2rem;
    }
}