/* Styling input fields */ 

input[type=text], input[type=email], input[type=number] {
    padding: 10px;
    border: 3px solid #000;
    width: 50%;
    font-family: inherit;
    position: relative; 
}

input::placeholder {
    font-family: Arial, Helvetica, sans-serif;
}

label p {
    margin: 0;
    width: 25%; 
    display: inline-block;
    
} 

label {
    font-family: Arial Black, Helvetica, sans-serif;
}

output {
    /* border: 1px solid #000;  Jelölő, hogy hová várhatunk kalkuláció eredményt, ez később eltávolítandó! */
    font-size: 6rem;
    font-weight: bold;
}

/* Styling buttons */

.my-button, input[type="submit"] {
    /* remove default behavior */
    appearance:none;
    -webkit-appearance:none;
  
    /* usual styles */
    padding: 10px;
    margin: 10px;
    border: 3px solid #000;
    background-color:black;
    color:#fff;
    font-weight: 600;
    width: 50%;
    cursor: pointer;
    position: relative;
    /* left: 114px; */
}


.my-button:active, input[type="submit"]:active {
    -webkit-box-shadow: inset 1px 1px 10px #FDD505;
    -moz-box-shadow:    inset 1px 1px 10px #FDD505;
    box-shadow:         inset 1px 1px 10px #FDD505;

}


/* Styling checkbox */

label {
    position: relative; /* to contain absolute elements */
    /* padding: 30px;   free space for custom checkbox */  
} 

/* hide default checkbox  */
label input[type=checkbox] {
    position: absolute; /* prevent taking any space */
    /* cross-browser hiding */
    opacity: 0;
    width: 0; 
    height: 0;
    
}

/* custom checkbox */
label span {
    position: absolute;
    /* position to the free space in <label> */
    top: 0;
    right: -30px;
    width: 20px; 
    height: 20px;
    background-color: white;
    border: solid black;
    border-radius: 20%;
    transition: .3s background-color; /* slight transition */
}

/* the check icon */
label span:after {
    content: "";
    position: absolute;
    display: none;
    
    /* check icon */
    left: 6px;
    top: 2px;
    width: 4px;
    height: 10px;
    border: solid black;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

label:hover span {
    background-color: white;
    cursor: pointer;
}
  
/**** Here's the trick ***/
label input:checked ~ span {
    background-color: #FDD505;
    border: solid black;
}

label input:checked ~ span:after {
    display:block;
}



/*Input valid-invalid designs*/
input:invalid:focus {
    background-color: red;
}

input[type=text]:valid:focus {
    background-color:  lightgreen;
}
input[type=email]:valid:focus {
    background-color:  lightgreen;
}
input[type=number]:valid:focus {
    background-color:  lightgreen;
}

input:not(:placeholder-shown):invalid {
    border: 5px solid red;
}

label input:invalid ~ span:after {
    background-color: red;
}



/* Responsive design */

@media screen and (max-width: 480px) {
    .my-button, input[type="submit"] {
        align-self: center;
        width: 70%;
    }

    label p {
        width: 100%; 
    } 

    input[type=text], input[type=email], input[type=number] {
        margin-top: 5px;
        width: 80%;
        left: 10%; 
    }

    output {
        font-size: 3rem;
    }

}

@media screen and (min-width: 481px) and (max-width: 1023px) {
    label p {
        width: 100%; 
    } 

    input[type=text], input[type=email], input[type=number] {
        margin-top: 5px;
        width: 70%;
        left: 15%;
    }
}
