:root {
    --accent1: #43a38e;
    --background: #f5f5f5;
    --accent2: #423c77;
    --shadow1: #7c77a8;
    --shadow2: #dfddee;
    --text: #333;
}

/* main page structure */

body {
    align-items: center;
    background-color: var(--background);
    display: flex;
    flex-flow: column nowrap;
    font-family: Helvetica, Arial, sans-serif;
    justify-content: center;
    line-height: 1.6;
    margin: 0;
    min-height: 100vh;
}

main {
    border-radius: 16px;
    box-shadow: 0 10px 25px var(--shadow1);
    margin: 2rem 0px;
    max-width: 340px;
    padding: 3rem;
}

header {
    background-color: var(--accent1);
    box-shadow: 0 5px 4px var(--shadow1);
    color: white;
    padding: .5rem;
    text-align: center;
    width: 100%;
}

header nav {
    background-color: var(--background);
}

header nav>a {
    display: block;
    font-size: 1.2em;
    padding: .5rem;
    text-decoration: none;
}

header nav>a:last-child {
    border-right: none;
}

header nav>a:hover {
    background-color: var(--shadow2);
}

footer {
    margin: .5rem;
    padding: .5rem;
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.5rem;
    margin: .5rem 0px;
}

p {
    margin-bottom: 2rem;
    margin-top: .5rem;
    font-size: 0.95rem;
}

/* table styling */

.table-container {  /* the container for the table in case table is too 
    wide for mobile screens - auto horiz scroll */
    max-width: 100%;
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    table-layout: auto;
    width: 100%;
}

td,
th {
    border: .05em dotted var(--accent1);
    color: var(--accent2);
    min-width: 125px;
    padding: .35em;
    width: 20%;
}

caption {
    color: var(--accent2);
    font-size: 1.2rem;
    font-weight: bold;
}

table td:last-child {
    font-family: monospace;
    font-size: 1.2rem;
    text-align: right;
}

/* form styling */

.req {  /* for required fields instruction */
    background-color: var(--shadow2);
}

form div,
fieldset {
    margin-top: 1.5rem;
}

fieldset,
input[type="text"],
input[type="email"],
button,
select {
    border-radius: 10px;
}

fieldset {
    border: .05rem solid var(--shadow1);
}
label,
legend {
    color: var(--accent2);
    font-weight: bold;
    letter-spacing: .05em;
    margin-bottom: .6rem;
}

label {
    display: block;
}

legend {
    margin-left: .25em;
    padding: 0px .4rem;
}

input[type="text"],
input[type="email"],
select,
button {
    font-size: 1rem;
}

input[type="text"],
input[type="email"],
select {
    border: .1rem solid var(--accent2);
    border: .1rem solid var(--accent2);
    color: var(--text);
    background-color: var(--background);
}

input[type="text"],
input[type="email"] {
    padding: .6rem .75rem;
    width: 90%;
}

input[type=text]:required,
input[type=email]:required {
    background-color: var(--shadow2);
}

table input[type="text"] {
    max-width: 100px;
}

input:focus {
    background-color: white;
    border-color: var(--accent1);
    outline: none;
}

button {
    background-color: var(--accent2);
    border: none;
    color: white;
    cursor: pointer;
    font-weight: bold;
    margin-top: 1rem;
    padding: .75em;
    width: 100%;
}

button:hover {
    background-color: var(--accent1);
}

/* I promised a little bit of <select> styling */
select {
    cursor: pointer;
    padding: .75rem .9rem;
    width: 100%;

    /* Removes the default browser arrow because now it's too small and
    shoved up against the right side */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Adds a custom SVG arrow that is easier to see */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23423c77' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

select:focus {
    background-color: white;
    border-color: var(--accent1);
    outline: none;
}

option {
    background-color: white;
    color: var(--accent2);
    padding: 1rem;
}


/* tablet screens */
@media only screen and (min-width: 768px) {
    main {
        max-width: 760px;
    }

    header {
        max-width: 100%;
    }

    header nav > a {
        border-right: .2rem solid var(--accent1);
        display: inline-block;
    }

    td,
    th {
        min-width: 130px;
    }
    
    table input[type="text"] {
        max-width: 110px;
    }
}

/* wide screens */
@media only screen and (min-width: 1098px) {
    main {
        max-width: 1085px;
    }

    td,
    th {
        min-width: 200px;
    }

    table input[type="text"] {
        max-width: 175px;
    }
  
}
