:root {
    --loader: #242323;
    --loader-border: hsl(32, 100%, 80%);
    --page-background: #f4f6f8;
    --form-background: #fff;
    --heidrive-orange: hsl(32, 100%, 64%);
    --heidrive-orange-focus: hsl(32, 82%, 59%);
    --input-focus: hsl(32, 100%, 60%);
    --border-grey: #ddd;
    --text-color: #242323;
    --placeholder-color: #6b6b6b;
    --redirect: #0066cc;
    --signature-pad: #f1f1f1;
    --legal-text-container: #f3f3f3;
    --progress-point-grey: rgb(194, 194, 194);
    --progress-point-active: rgb(255, 175, 122);
    --progress-point-current: rgb(255, 131, 49);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    min-height: 100vh;
    overflow: auto;
    background-color: var(--page-background);
    display: grid;
    place-content: center;
    color: var(--text-color);
    font-family: "Inter", Helvetica, Arial, sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    transition: background-color 0.3s ease;
}

#header {
    display: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#form-container {
    width: 100vw;
    max-width: 420px;
    min-width: 420px;
    padding: 35px 25px;
    background-color: var(--form-background);
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.219);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: auto;
    transition: background-color 0.3s ease;
}

.mode-button {
    width: 30px;
    position: absolute;
    top: 7px;
    right: 7px;
    filter: brightness(60%);
    transition: 0.2s ease;
}

@media (hover: hover) {
    .mode-button:hover {
        transform: scale(109%);
        filter: brightness(80%);
    }
}

#input-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.text-label {
    width: 100%;
    margin-bottom: 10px;
    position: relative;
    border-bottom: 1px solid var(--border-grey);
    color: var(--placeholder-color);
    transition: color 0.2s ease;
}

.input {
    width: 100%;
    padding: 10px 0px;
    margin-top: 20px;
    border: none;
    outline: none;
    font-size: 1em;
    background-color: transparent;
    color: var(--text-color);
}

.input::placeholder {
    opacity: 0;
}

.label-span {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateY(30px);
    font-size: 1em;
    transition-duration: 300ms;
    color: var(--placeholder-color);
    cursor: text;
}

label:focus-within>.label-span,
.input:not(:placeholder-shown)+.label-span {
    color: var(--input-focus);
    transform: translateY(0px);
}

#checkboxDiv {
    width: 100%;
    display: grid;
    grid-template-areas:
        "checkbox description";
    gap: 14px;
    justify-content: center;
    align-items: center;
    margin-top: 25px;
    margin-bottom: 10px;
}

#acceptCheckbox {
    grid-area: checkbox;
    height: 16px;
    width: 16px;
}

#accept-checkbox-label {
    font-size: 1em;
    grid-area: description;
}

#legal-text-container {
    height: 350px;
    overflow: auto;
    border-radius: 8px;
    padding: 5px;
    padding-right: 15px;
    background-color: var(--legal-text-container);
}

.legal-text-h1 {
    font-size: 1.1em;
    font-weight: bold;
    text-align: left;
    margin-bottom: 30px;
}

.legal-text {
    color: var(--text-color);
    font-size: 1em;
    font-weight: normal;
    text-align: left;
}

.legal-text-list {
    margin-left: 20px;
    margin-bottom: 20px;
}

.legal-text-list li {
    margin-bottom: 10px;
}

.logo {
    width: 80%;
    margin-bottom: 33px;
    max-width: 300px;
    min-width: 250px;
}

#logo {
    display: block;
}

#logo-dark-mode {
    display: none;
}

#instruction {

    margin-bottom: 30px;
}

p {
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.2em;
    font-size: 1.1em;
}

.line {
    width: 100%;
    height: 1px;
    border-bottom: 1px solid var(--border-grey);
    margin-bottom: 10px;
}

.submit-button {
    position: relative;
    width: 100%;
    margin-top: 25px;
    height: 45px;
    min-height: 45px;
    font-size: 1.1em;
    border: none;
    background-color: var(--heidrive-orange);
    border-radius: 10px;
    overflow: hidden;
    color: var(--text-color);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.168);
    transition: 0.2s ease;
}

@media (hover: hover) {
    .submit-button:hover {
        background-color: var(--heidrive-orange-focus);
        box-shadow: 5px 5px 18px rgba(0, 0, 0, 0.3);
        transform: scale(101%);
    }
}

.submit-button:active {
    transform: scale(102%);
}

.loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 5px solid var(--loader-border);
    border-top: 5px solid var(--loader);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.submit-button.loading .btn-text {
    visibility: hidden;
}

.submit-button.loading .loader {
    display: block;
}

#canvas-wrapper {
    position: relative;
    margin-bottom: 20px;
}

canvas {
    border: 1px solid var(--border-grey);
    width: 100%;
    height: 250px;
    border-radius: 10px;
    background-color: #e9e9e9;
    transition: 0.1s ease;
}

#reset-signature {
    color: #242323;
    border: none;
    margin: 0 auto;
    font-size: 0.9em;
    padding: 5px;
    border-radius: 5px;
    border: 1px solid var(--border-grey);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.168);
    background-color: #fff;
    position: absolute;
    bottom: 10px;
    right: 10px;
    transition: 0.2s ease;
}

@media (hover: hover) {
    #reset-signature:hover {
        transform: scale(102%);
        border: 1px solid red;
    }
}

#reset-signature:active {
    transform: scale(103%);
    border: 1px solid red;
}

#progress-indicator {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
}

.progress-point {
    height: 5px;
    width: 30%;
    background-color: var(--progress-point-grey);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.138);
    transition: 0.245s ease;
}

.progress-point-active {
    background-color: var(--progress-point-active);
    position: relative;
}

.progress-point-currentlyVisible {
    background-color: var(--progress-point-current);
    width: 35%;
    height: 6px;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

#submit-state {
    font-weight: bold;
    font-size: 1.1em;
}

#submit-message {
    width: 85%;
    font-size: 1em;
    line-height: 1.4em;
}

#redirect {
    display: block;
    text-align: center;
    color: var(--redirect);
    text-decoration: none;
    font-size: 1em;
}

#line-submit {
    margin-bottom: 30px;
}

@media screen and (max-width: 600px) {
    :root {
        --page-background: #fff;
        --form-background: #fff;
    }

    #form-container {
        min-width: 100vw;
        min-height: 100vh;
        border-radius: 0;
        padding: 25px 15px 40px 15px;
        box-shadow: none;
    }
}

[data-theme="dark"] {
    --page-background: rgb(32, 32, 32);
    --form-background: rgb(44, 44, 44);
    --heidrive-orange: #e67330;
    --heidrive-orange-focus: #a15021;
    --input-focus: #e67330;
    --loader: #000;
    --loader-border: #ce8255;
    --border-grey: rgb(75, 75, 75);
    --text-color: rgb(233, 233, 233);
    --placeholder-color: rgb(194, 194, 194);
    --redirect: rgb(122, 147, 255);
    --signature-pad-button: #4d4d4d;
    --legal-text-container: #3f3f3f;
    --progress-point-grey: rgb(97, 97, 97);
    --progress-point-active: #a15021;
    --progress-point-current: #e67330;

    #logo-dark-mode {
        display: block;
    }

    #logo {
        display: none;
    }

    .input {
        box-shadow: none;
    }

    button {
        box-shadow: none;
    }

    button:hover {
        box-shadow: none;
    }

    #form-container {
        box-shadow: none;
        border: 1px solid var(--border-grey);
    }

    .progress-point {
        box-shadow: none;
    }

    @media screen and (max-width: 600px) {
        #form-container {
            border: none;
        }

        body {
            --page-background: rgb(44, 44, 44);
        }
    }
}