* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    outline-color: transparent;
    -webkit-user-select: none; /* Safari*/
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax *//* CSS user-select Property */
}
/*  Certain types of motion-based animations can cause discomfort for some users. In particular, 
    people with vestibular disorders have sensitivity to certain motion triggers. */
/*  The @media at-rule has a media feature called prefers-reduced-motion to set CSS based on the user's preferences. 
    It can take one of the following values: 
        reduce 
        no-preference. 
*/

@media (prefers-reduced-motion: no-preference) {
    * {scroll-behavior: smooth;
    }
}

:root {
    --Beige: Beige;
    --Black:  hsl(0, 0%, 20%);
    --Chocolate: Chocolate;
    --DarkBlue: DarkBlue;
    --DarkCian: DarkCyan;
    --Gainsboro: Gainsboro;
    --Green: Green;
    --Gray: Gray;
    --IndianRed: IndianRed;
    --Olive: Olive;
    --Maroon: Maroon;
    --SaddleBrown:SaddleBrown;
    --SeaGreen: SeaGreen;
    --White: White;
    --WhiteSmoke: WhiteSmoke;
 }

body {
    font-family: Arial, sans-serif;
    background-color: var(--WhiteSmoke);
}

/*  In common */
.flexBox {
    display: flex;
    justify-content:center;
    align-items: center;
    flex-flow: column nowrap;
}

/*  main container is a flex box. */
#application-form {
    margin-inline: auto;
    row-gap: 1.5rem;
    padding: 1.5rem 0;
    text-align: center;
}

#application-form header {
    width: 100%;
    padding: 0 0 1.5rem 0;
    border-block-end: 5px solid var(--White);
}

#application-form .titleAppForm {
    font: 600 45px "Open sans", sans-serif;
}

/*  description for title */
.description {
    text-align: center;
    font-size: 1.2rem;
    padding: 8px 0 0 0;
}

/*
    The grid-area property specifies a grid item's size and location in a grid layout. */
/*
    The grid-area property can also be used to define the order of the grid item.
 */

/*  Comments about HTML Forms */
.gridItem1 {grid-area: title;}
.gridItem2 {grid-area: leftCol;}
.gridItem21 {grid-area: title1;}
.gridItem211 {grid-area: code1;}
.gridItem212 {grid-area: code2;}
.gridItem213 {grid-area: code3;}
.gridItem214 {grid-area: code4;}
.gridItem215 {grid-area: code5;}
.gridItem216 {grid-area: code6;}
.gridItem217 {grid-area: code7;}
.gridItem22 {grid-area: title2;}
.gridItem221 {grid-area: description1;}
.gridItem222 {grid-area: description2;}
.gridItem223 {grid-area: description3;}
.gridItem224 {grid-area: description4;}
.gridItem225 {grid-area: description5;}
.gridItem226 {grid-area: description6;}
.gridItem227 {grid-area: description7;}
.gridItem3 {grid-area: rightCol;}

/*  section */
/*  Comments about HTML Form */
#about-forms {
    display: grid;
    grid-template-areas: 
    'title   title' 
    'leftCol rightCol';
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.5rem 3rem;
    text-align: left;
    padding: 0 1rem;
}

#about-forms .titleSection {
    font: small-caps 500 24px  Arial, sans-serif;
    margin: 4px 0 0 0;
}

/*  aside tag | leftCol */
#definition-usage {
    max-width: 600px;
    font-size: 1.2rem;
    align-self: center;
}

[id="definition-usage"] p:not(#description-terms p) {
    padding: 8px 0;
}

/*  blockquote */
#description-terms {
    display: grid;
    grid-template-areas: 
    'title1  title2'    
    'code1 description1'
    'code2 description2'
    'code3 description3'
    'code4 description4'
    'code5 description5'
    'code6 description6'
    'code7 description7';
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
    padding: 32px 16px;
}

code {
  font-family: Consolas,"courier new";
  color: var(--DarkBlue);
  background-color: #f1f1f1; /* special effect */
  padding: 2px;
  font-size: 105%;
}

[id="about-forms"]:last-child {
    justify-self: flex-end;
}

/*  Styling form *//* grid item & flex box */    
#collect-user-input {
    align-items: flex-start;
    row-gap: .5rem;
    background-color: var(--White);
    border: 2px solid var(--Gainsboro);
    border-radius: 3px;
    padding: 3rem;
    box-shadow: 0 4px 8px var(--Gray);
    font-size: 1.1em;
    width: 100%;
    max-width: 600px;
}

input[type="text"],
input[type="email"],
select {
    display: block;
    width: 100%;
    padding: .8rem 1.5rem;
    margin: 0 0 0.8rem 0;
    border-radius: 5px;
    background-color: var(--White);
    color: var(--Black);
}

/*  Necessary for placeholder */
input[type="text"],
input[type="email"],
#position,
#collect-comments {
    font-size: 1.1rem
}

/*  fieldset */
.radio-group {
    display: flex;
    flex-flow: row wrap;
    align-items: baseline;
    width: 100%;
    padding: .8rem 1.5rem;
    gap: .8rem;
    margin: 0 0 .8rem 0;
    border: 2px solid var(--Green);
}

.radio-group input[type="radio"] {
    display: inline-block;
    appearance: none; /* appearance property set to none to remove the default styling applied by the browser to checkbox inputs*/
    -webkit-appearance: none;
    width: 16px;
    height:16px;
    border-radius: 50%;
    background-color: var(--Gainsboro);
    cursor: pointer;
}

.radio-group input[type="radio"]:checked {
    outline: 2px solid var(--Green);
    outline-offset: 4px;
    border: 4px solid var(--Green);
    background-color: var(--White);
    box-shadow: 0 2px 5px var(--Gray);
}

/*  Combinator +: Select and style the <label> element that are placed immediately after (not inside) 
    <input type="radio"> elements: 
*/
.radio-group input[type="radio"]:checked + label{
    color: var(--Green);
}

.radio-group input[type="radio"]:hover {
    outline: 2px solid var(--Gray);
    border: 2px solid var(--White);
    background-color: var(--Gray);
    box-shadow: 0 0px 5px var(--Gainsboro);
}

/*  textarea */
#collect-comments  { 
    width: 100%;
    height: 150px;
    padding: .8rem 1.5rem;
    margin: 8px 0;
    border: 5px solid;
    border-radius: 5px;
    background-color: hsl(48, 38%, 95%);
    font-size: 1.1em;
}

/*  Submit the form */
#submitTheForm {
    width: 100%;
    display: block;
    padding: .8rem 1.5rem;
    margin: 1.5rem 0 0 0;
    outline-color: transparent;
    color: var(--White);
    background-color: var(--SaddleBrown);
    border-radius: 10px;
    transition: transform 0.3s, background-color 0.3s ease-in-out;
    font-size: 1.1em;
}

input[type="text"]:focus,
input[type="email"]:focus {
    outline: 3px solid var(--IndianRed);
    border: 3px solid var(--IndianRed);
}
      
#collect-comments:focus {
    outline: 3px solid var(--SeaGreen);
}

/*  When validating forms, you can use the :valid pseudo-class to style the input fields that meet the validation criteria, 
    and :invalid to style the input fields that do not meet the criteria. 
    Typically, you will use green for a valid input and red for an invalid input.
*/
input[type="text"]:valid,
input[type="email"]:valid,
select:valid,
#collect-comments:valid {
    border: 4px solid var(--Green)
}

input[type="text"]:invalid,
input[type="email"]:invalid,
select:invalid,
#collect-comments:invalid {
    border: 4px solid var(--IndianRed);
}

#submitTheForm:hover {
    background-color: var(--Olive);
    transform: scale(1.1);
}
      
/*  Selects first element among any group of siblings: it is <textarea> */
input:nth-child(1) {
    background-color: var(--Gainsboro);
}

/*  link */
#more-information {
    display: inline-block;
    color: var(--DarkBlue);
    background-color: #f1f1f1;
    padding: 2px 6px;
}

.line {
    text-decoration: underline;
    text-decoration-thickness: 2px; /* To set the thickness of the decoration line. */
    text-underline-offset: 5px; /* To improve readability, I use CSS properties like text-underline-offset to separate the text from the line. */
}

#more-information:hover {
    text-decoration: none;
    text-decoration-thickness: 0;
    text-underline-offset: 0;
    color: #fffff0; /* ivory */
    background-color: rgb(82, 73, 45);
    border-radius: 7px;
}
      
/*
    The align-self property specifies the alignment in the block direction for the selected item inside a flexbox or grid container. 
    The align-self property overrides the grid or flexible container's align-items property.
*/
/* <span> */
.math_operators {
    color: var(--Maroon);
}

.symbol {
    align-self: flex-end;
}

.whiteSpace {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
}

/*  For iPads, Tablets, Small screens of laptops */
/*  Responsive layout - when the screen is less than 1024px wide, make the two columns stack on top of each other instead of next to each other */
@media only screen and (max-width: 1024px) {
    #about-forms {
        grid-template-areas: 
        'title'
        'leftCol'
        'rightCol';
        grid-template-columns: auto; 
        grid-template-rows: auto; 
    }

    select {
        display: block;
        width: 100%;
        padding: .8rem 1.5rem;
        margin: 0 0 0.8rem 0;
        border-radius: 5px;
        background-color: var(--White);
        color: var(--Black);
    }

    /*  fieldset */
    .radio-group {
        display: flex;
        flex-flow: row wrap;
        align-items: baseline;
        width: 100%;
        padding: .8rem 1.5rem;
        gap: .8rem;
        margin: 0 0 .8rem 0;
        border: 2px solid var(--Green);
    }

    .radio-group input[type="radio"] {
        display: inline-block;
        appearance: none; /* appearance property set to none to remove the default styling applied by the browser to checkbox inputs*/
        -webkit-appearance: none;
        width: 16px;
        height:16px;
        border-radius: 50%;
        background-color: var(--Gainsboro);
        cursor: pointer;
    }   

    .radio-group input[type="radio"]:checked {
        outline: 2px solid var(--Green);
        outline-offset: 4px;
        border: 4px solid var(--Green);
        background-color: var(--White);
        box-shadow: 0 2px 5px var(--Gray);
    }

    /*  Combinator +: Select and style the <label> element that are placed immediately after (not inside) 
    <input type="radio"> elements: 
    */
    .radio-group input[type="radio"]:checked + label{
        color: var(--Green);
    }

    .radio-group input[type="radio"]:hover {
        outline: 2px solid var(--Gray);
        border: 2px solid var(--White);
        background-color: var(--Gray);
        box-shadow: 0 0px 5px var(--Gainsboro);
    }
}
      
/*  A common breakpoint used for media queries: mobile devices. */
 @media (min-width: 320px) and (max-width: 480px) {   
    #application-form {
        background-color: var(--Beige);
    }

    /*  fieldset */
    .radio-group label{
        width: 20%;
    }
}