/******** Styles that apply broadly to elements across components ********/

html,body,button,input,textarea {
    font-size: 18px;
    font-family: Arial, sans-serif;
    line-height: 1.2;
    margin: 0;
}

body {
    margin-bottom: 5rem;  /* Prevent overlap with index-probe-footer */
    user-select: none;
}

h1 {
    font-size: 2em;
}

h2 {
    font-size: 1.5em;
}

h3 {
    font-size: 1.25;
}

button,input[type=submit] {
    margin-left: 1em;
    margin-right: 1em;
    padding: 1em 2em 1em 2em;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: .5em;
    color: #444;
    cursor: pointer;
}

button:focus,input[type=submit]:focus {
    outline: .15em solid #696;
    -moz-outline-radius: .5em;
}

button:hover,input[type=submit]:hover {
    background: #eee;
}

button:disabled,input[type=submit]:disabled {
    visibility: hidden;
}

input[type=text],textarea {
    border: .1em solid #000;
    padding: .5em;
}

input[type=text]:focus,textarea:focus {
    outline: 2px solid #696;
}

video {
    display: block;
    margin: 2em auto;
    max-width: calc(100% - 3em);
    pointer-events: none;  /* Disables some right-click play/pause/download options */
}

textarea {
    max-width: 30em;
    width: calc(100% - 1em);
    height: 15em;
}

.text-content {
    margin: 0 auto;
    padding: 2em;
    max-width: 50em;
}

.total-failure span {
    display: block;
    font-size: 2rem;
    margin: 2rem 0 2rem 2rem;
}

span.total-failure-error {
    font-size: 1rem;
}

#index-alert {  /* This is intended to modify .overlay options */
    background-color: #fffe;
    z-index: 100;
}

#index-alert-box {
    margin: auto;
    margin-top: 30vh;
    max-width: 40em;
    padding: 2em;
}

#index-alert-message {
    margin-bottom: 2em;
    text-align: left;
}

/******** Custom radio/checkbox styles ********/
/* This assumes a <label><input><div></label> structure */

input[type=radio],
input[type=checkbox] {
    margin-top: 4px;
    margin-right: 6px;
    float: left;
}

label {
    cursor: pointer;
}

label > input[type=radio],
label > input[type=checkbox] {
    opacity: 0;
    width: 0;
    height: 0;
}

label > input[type=radio] ~ div:before,
label > input[type=checkbox] ~ div:before {
    box-sizing: border-box;
    width: 1.15em;
    height: 1.15em;
    border-radius: 1.15em;
    top: .2em;
    left: -.3em;
    position: relative;
    background-color: #fff;
    content: '';
    display: inline-block;
    visibility: visible;
    border: .1em solid #000;
}

label > input[type=checkbox] ~ div:before {
    border-radius: 0;
}

label > input[type=radio]:checked ~ div:before {
    background-color: #696;
    box-shadow: inset 0 0 0 .1em #fff;
}

label > input[type=radio]:focus ~ div:before,
label > input[type=checkbox]:focus ~ div:before {
    outline: .15em solid #696;
}

label > input[type=radio]:focus ~ div:before {
    -moz-outline-radius: 1.15em;
}

label > input[type=checkbox]:checked ~ div:before {
    background-color: #696;
    background-image: url("data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjxyZWN0IGNsYXNzPSJjbHMtMSIgeD0iMTIuNDEiIHk9IjI1LjcyIiB3aWR0aD0iNTYuMTEiIGhlaWdodD0iOC4wNiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTYuMDUgNDguNjkpIHJvdGF0ZSgtNTguNDgpIi8+PHJlY3QgY2xhc3M9ImNscy0xIiB4PSIwLjU5IiB5PSIzMi4zIiB3aWR0aD0iMzEuOTQiIGhlaWdodD0iOC4wNiIgdHJhbnNmb3JtPSJtYXRyaXgoLTAuNTcsIC0wLjgyLCAwLjgyLCAtMC41NywgLTMuNzcsIDcwLjY5KSIvPjwvc3ZnPg==");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: .7em;
}

/******** General probe styles ********/

.overlay {
    display: none;
    position: fixed;
    height: 100%;
    width: 100%;
    padding-top: 1em;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: #fff;
    overflow-y: auto;
    z-index: 10;
}

#index-probe-footer {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 4rem;  /* This has to be complemented by a body bottom margin to prevent overlap */
    z-index: 2;
    background-color: #fffe;
    text-align: center;
    padding: 1rem;
    box-sizing: border-box;
    box-shadow: 0 1.4em .8em 1em #000;
}

#index-probe-footer button {
    height: 2rem;
    padding-top: 0;
    padding-bottom: 0;
}

#index-probe-response-options label {
    display: block;
    margin: 1em;
}

#index-probe-response-options textarea {
    margin-top: 1em;
}

#index-probe-response-options button {
    margin-top: 1em;
}

#index-probe-continue {
    margin: 2em;
}

/******** MW grid probes ********/

.probegrid-container {
    display: flex;
    margin-top: 1em;
}

.probegrid-options-container {
    line-height: 0;
}

.probegrid-item {
    display: inline-block;
    background-color: #696;
    outline: 1px solid #000;
}

.probegrid-item:hover {
    background-color: #7a7;
}

.probegrid-item-selected,.probegrid-item-selected:hover {
    background-color: #444;
}

.probegrid-axis-label {
    font-weight: bold;
    text-align: center;
    margin-top: .6em;
}

.probegrid-axis-vertical {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    margin: 0 .2em .6em 0;  /* To account for x-axis top margin */
}

/******** Media queries ********/

@media screen and (max-width: 700px) {
    html,body,button,input,textarea {
        font-size: 2.5vw;
    }
}
