@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');



:root {
    --fw-700: 700;

    --Green-200: hsl(173, 61%, 77%);
    --Green-400: hsl(172, 67%, 45%);
    --Green-750: hsl(183, 79%, 24%);
    --Green-800: hsl(183, 85%, 21%);
    --Green-900: hsl(183, 100%, 15%);
    --Grey-500: hsl(186, 14%, 43%);
    --Grey-400: hsl(184, 14%, 56%);
    --Grey-200: hsl(185, 41%, 84%);
    --Grey-50: hsl(189, 47%, 97%);
    --White: hsl(0, 100%, 100%);
}

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


html,
body {
    height: 100%;
   
}

body {
    color: var(--Grey-500);
    font-weight: var(--fw-700);
    font-size: 1rem;
    font-family:  "Space Mono", monospace;
    background-color: var(--Grey-200);
}

main {
   height: 100%;
   /* min-height: 800vh; */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 5rem;
    /* padding: 5rem; */
    margin-inline: auto;
    margin-top: -3rem;
}

li {
    list-style: none;
}

img {
    display: block;
}

h1{
    width: 10ch;
    word-wrap: break-word;
    letter-spacing: 1rem;
    font-size: 1.5rem;
}

.wrapper {
    display: flex;
    background-color: white;
    padding: 2rem;
    gap: 3rem;
    border-radius: 1.5rem;
    width: 70%;
    max-width:920px;
    
}

.wrapper>* {
    flex: 1;
    
}

form {
    display: grid;
    gap: 2rem;
}

.form-group {
    display: grid;
    align-content: center;
    gap: 0.5rem;
    position: relative;
}


.error{
    position: absolute;
    right: 0;
    color: red;
}
ul {

    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(50px, 1fr));
    gap: 1rem;
    margin-top: .25rem;
}



button,
.tip__custom {
    padding: 0.5rem 0;
    font-size: 1.5rem;
    text-align: center;
    width: 100%;
    outline: 1px solid ;
    border: 1px solid ;
    font-family: inherit;

}

input {
    padding: 0.5rem 0.75rem;
    background-color: var(--Grey-50);
    border: none;
    outline: none;
    text-align: right;
    font-size: 1.5rem;
    color: var(--Green-900);
    font-weight: var(--fw-700);
    direction: ltl;
    font-family: inherit;
   

}
.tip__custom{
     border: 1px solid var(--Grey-50);
   outline: 1px solid var(--Grey-50);
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;

}

input[type=number] {
    -moz-appearance: textfield;
}

.input-wrapper input {
    margin-left: auto;
    width: 87.5%;
    border-radius: inherit;
   

}

.input__icon {
    position: absolute;
    left: 0;
    padding: 0 .25rem;
    width: 12.5%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.25rem;

}


.tip__btn {
    background-color: var(--Green-900);
    color: white;
    font-weight: 700;
    border-radius: 5px;
    cursor: pointer;
}


.tip__btn:hover {
    background-color: var(--Green-400);
    color: var(--Green-900);
    border: 1px solid var(--Green-400);
    outline: 1px solid var(--Green-400);
}

.tip__custom:focus {
    text-align: right;
    padding-inline: .5rem;
}

.tip__custom:focus::placeholder {
    color: transparent;
}

.input-wrapper {
    position: relative;
    background-color: var(--Grey-50);
    display: flex;
    border-radius: 5px;
     border: 1px solid var(--Grey-50);
   outline: 1px solid var(--Grey-50);

}

.tip__details{
    background-color: var(--Green-900);
    border-radius: 15px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
}

#reset{
    border-radius: 5px;
    background-color: var(--Green-400);
    color: var(--Green-900);
    font-size: 1.5rem;
    font-weight: inherit;
    text-transform: uppercase;
    cursor: pointer;

}

.active, #reset:hover{
    background-color: var(--Green-200);
}


.active-inp,.input-wrapper:focus-visible{
    border: 1px solid var(--Green-400);
    outline: 1px solid var(--Green-400);
}

.input-err{
    border: 2px solid red;
    outline: 2px solid red;
}

.tip__info{
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info__amount{
    color: white;
}

.tip__info__amount{
    font-size: 3rem;
    color: var(--Green-400);
}


@media (max-width:1023px) {
    .wrapper{
        flex-direction: column;
        padding: 3rem 5rem;
        min-width: fit-content;
    }
    
    main{
        margin: 2rem;
    }
}

@media (max-width:767px) {
    main{
        align-items:center;
        
    }
    .wrapper{
        width: 100%;
        flex: 1;
        padding: 2rem;
    }

    ul{
    grid-template-columns: repeat(2, minmax(50px, 1fr));

    }

    .tip__info__amount{
        font-size: 2.5rem;
    }

     main{
        margin: 0;
    }
}



#reset:disabled{
    background-color: var(--Green-800);
    color: var(--Green-900);
    cursor: not-allowed;
}
.attribution {
    font-size: 11px;
    text-align: center;
}

.attribution a {
    color: hsl(228, 45%, 44%);
}