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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Space Mono', monospace;
}

body {
    background-color: hsl(185, 41%, 84%);
}

/* CUSTOM CONFIG */
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

/* CHANGE INPUT DIRECTION */
input.rtl {
    text-align: end;
}
/* END CONFIG */

.head-logo img {
    width: 60px;
}

.main-box {
    width: 60%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
    gap: 35px;
}

.container {
    height: 370px;
    width: 100%;
    padding: 26px;
    background-color: hsl(0, 0%, 100%);
    border-radius: 20px;
    box-shadow: -15px 15px 30px hsla(189, 14%, 56%, 0.322);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}
.container .calculation-box {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

label.input-label {
    color: hsl(186, 14%, 43%);
    font-weight: bolder;
    display: inline-block;
    margin-bottom: 5px;
    font-size: 14px;
}

.error-msg {
    position: absolute;
    font-size: 14px;
    font-weight: bolder;
    right: 0;
    color: #d46d4e;
    display: none;
}

.input-box {
    position: relative;
    width: 100%;
    height: 40px;
}

.input-box img {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 12px;
    width: 10px;
}

.input-box input,
.input-group .tip-input-box input {
    height: 100%;
    width: 100%;
    border: none;
    border-radius: 5px;
    background-color: hsl(189, 41%, 97%);
    color: hsl(183, 100%, 15%);
    font-size: 20px;
    font-weight: bolder;
    padding: 0 12px;
}

.input-box input:focus,
.input-group .tip-input-box input:focus {
    outline: none;
    border: 2px solid hsl(172, 67%, 45%);
}

.calculation-box .bill-box {
    height: 30%;
}
.calculation-box .tip-box {
    height: 40%;
}
.calculation-box .people-box {
    height: 30%;
    margin-top: 8px;
    position: relative;
}
.calculation-box .people-box .input-box.error > input {
    border: 2px solid #d46d4e;
}

.tip-box .input-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    row-gap: 12px;
    margin-top: 10px;
}

.tip-box .input-group .tip-check-box {
    position: relative;
    width: 31%;
    height: 40px;
    background-color: hsl(183, 100%, 15%);
    text-align: center;
    border-radius: 5px;
    cursor: pointer;
    color: white;
    transition: .3s;
}

.tip-box .input-group .tip-check-box:hover{
    background-color: hsl(185, 41%, 84%);
    color: hsl(183, 100%, 15%);
}

.tip-box .input-group .tip-check-box.active {
    background-color: hsl(172, 67%, 45%);
    color: hsl(183, 100%, 15%);
}

.tip-box .input-group .tip-check-box p {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    font-weight: bolder;
    font-size: 20px;
    z-index: 1;
    pointer-events: none;
}

.input-group .tip-input-box {
    width: 31%;
    height: 40px;
}

.container .results-box {
    width: 50%;
    height: 100%;
    background-color: hsl(183, 100%, 15%);
    border-radius: 15px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Result Box Nominal */
.results-box .result-box-nominal {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 25px;
}

.result-box-nominal .result-box-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-box-detail .result-nominal {
    color: hsl(172, 67%, 45%);
    font-size: 36px;
    font-weight: bold;
}

.result-desc .desc-title {
    color: hsl(0, 0%, 100%);
    font-size: smaller;
    font-weight: bolder;
}

.result-desc .desc-subtitle {
    color: hsl(184, 14%, 56%);
    font-size: 13px;
    font-weight: bolder;
}

/* Reset Button */
#btnReset {
    transition: .3s;
    padding: 8px 0;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    color: hsl(183, 100%, 15%);
    background-color: hsl(172, 67%, 45%);
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#btnReset:disabled {
    opacity: .3;
    cursor: not-allowed;
}

#btnReset:not(:disabled):hover {
    background-color: hsl(185, 41%, 84%);
}

#btnReset:not(:disabled):active {
  background-color: hsl(172, 67%, 45%);
}

.attribution { 
    font-size: 14px; 
    text-align: center; 
    font-family: 'Space Mono', monospace;
    color: hsl(183, 100%, 15%);
}

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

/* RESPONSIVE */
@media only screen and (max-width: 600px) {

    .head-logo img {
        width: 70px;
    }

    .main-box {
        width: 100%;
        gap: 35px;
        height: 100%;
        padding-top: 35px;
    }

    .container {
        height: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 30px 26px;
        border-radius: 20px 20px 0 0;
    }

    .container .calculation-box {
        width: 100%;
        height: 50%;
    }

    .container .results-box {
        width: 100%;
        height: 50%;
        gap: 35px;
    }
    
    .result-desc .desc-title {
        font-size: 16px;
    }
    .result-desc .desc-subtitle {
        font-size: 15px;
    }

    label.input-label {
        margin-bottom: 8px;
        font-size: 16px;
    }

    
    .tip-box .input-group .tip-check-box, 
    .input-group .tip-input-box {
        width: 47%;
        height: 45px;
    }

    .attribution {
        display: none;
    }
}
