/* ------------------------------------ */
/* Colors                               */
/* ------------------------------------ */

:root {
    --primary: #0066b3;
    --secondary: #005fb0;
    --green: #3cb44a;
    --red: #ea1f25;
    --warning: #ba2121;
    --bg-gray: #f6f6f6;
    --border-gray: #eee;
    --border-dark: #a8a8a8;
    --text-color: #333;
}

/* ------------------------------------ */
/* Fonts                                */
/* ------------------------------------ */

body {
    font-size: 14px;
    line-height: 1.5em;
    color: #333;
    font-family: 'Arial', Arial, Helvetica, sans-serif;
}

p, span,
label,
input,
table tr td,
table tr th {
    font-size: 14px !important;
}

/* ------------------------------------ */
/* Layout                               */
/* ------------------------------------ */

.form-wrapper {
    margin: 0 auto;
    width: 600px;
    padding: 20px 15px !important;
    max-width: calc(100vw - 30px);
    min-height: calc(100vh - 107px - 29px - 40px);
    max-width: calc(100dvw - 30px);
    min-height: calc(100dvh - 107px - 29px - 40px);
}

.form-row {
    border: none !important;
    padding: 10px 0 !important;
}
.form-row label {
    display: block;
}

.form-row input[type=text],
.form-row input[type=email],
.form-row textarea {
    width: calc(100% - 18px);
    margin-left: 2px;
    padding: 5px 6px !important;
    min-height: 14px !important;
}
@media (max-width:762px) {
    .form-row input[type=text],
    .form-row input[type=email],
    .form-row textarea {
        width: calc(100% - 8px);
    }
}

.table-uploads {
    width: 100%;
    margin: 20px 0 10px 0;
}
.table-uploads tbody {
    position: relative;
}
button {
    margin: 20px auto;
    display: block;
}

/* ------------------------------------ */
/* Header                               */
/* ------------------------------------ */

header {
    margin: 0 auto;
    text-align: center;
}
header .orto-logo {
    max-height: 40px;
    padding: 20px 0 0 0;
}
header h1 {
    font-weight: 600;
    color: var(--primary);
}

/* ------------------------------------ */
/* Footer                               */
/* ------------------------------------ */

footer {
    padding: 4px;
    background-color: var(--primary);
}
footer {
    color: #fff;
    text-align: center;
}

/* ------------------------------------ */
/* Form                                 */
/* ------------------------------------ */

span.required {
    color: var(--warning);
}

label[for=id_privacy] {
    display: none !important;
}
span.privacy {
    display: inline-block;
}

a.delete {
    position: relative;
    top: 8px;
    float: right;
}

.table-uploads tr td,
.table-uploads tr th {
    border-bottom: 1px solid var(--hairline-color) !important;
    font-weight: 400;
}
tr:nth-child(2n+1), .row-form-errors {
	background: transparent !important;
}
tr:nth-child(2n), tr:nth-child(2n) .errorlist, tr:nth-child(2n+1) + .row-form-errors, tr:nth-child(2n+1) + .row-form-errors .errorlist {
	background: transparent !important;
}
thead th {
	padding: 8px 12px 6px 12px;
}

input[type=checkbox] {
    margin-left: 2px;
    margin-right: 6px;
    position: relative;
    top: -2px;
}
.errors input[type=checkbox] {
    box-shadow: 0px 0px 0px 1px var(--error-fg) !important;
}

.error-msg {
    color: var(--warning);
    display: block;
}

button {
    background: var(--primary);
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    color: var(--button-fg);
    cursor: pointer;
    transition: background 0.15s;
}
button:hover {
    background: var(--secondary);
}

.add-row.btn {
    display: inline-block;
    padding-top: 4px;
}
.add-row.btn:before {
    content: url(../img/icon-add.svg);
    display: inline-block;
    width: 16px;
    height: 20px;
    position: relative;
    top: 2px;
}

ul.messagelist li {
    padding: 11px 10px 9px 36px;
	font-weight: 600;
    background-position: 12px 12px;
}

/* ------------------------------------ */
/* Scanner                              */
/* ------------------------------------ */

#scanner video,
#scanner #canvas {
    display: none;
}

#scanner #result,
#scanner #cropped {
    width: 100%;
    height: auto;
}

#scan_button {
    display: inline-block;
    padding-top: 4px;
    position: absolute;
    right: 0;
}
#scan_button:before {
    content: url(../img/icon-scan.svg);
    display: inline-block;
    width: 18px;
    height: 18px;
    position: absolute;
    top: 2px;
    left: -28px;
}

@media (min-width:762px) {
    #scan_button {
        /* display: none; */
    }
}

#scanner {
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(0,0,0,0.25);
    width: 100vw;
    height: 100vh;
    width: 100dvw;
    height: 100dvh;
}

#scanner .inner {
    background: #fff;
    margin: auto;
    width: 100%;
    height: 100%;
}
.canvas-wrapper {
    height: calc(100vh - 76px);
    height: calc(100dvh - 76px);
}
.button-wrapper {
    display: flex;
    height: 76px;
}
    
/* ------------------------------------ */
/* Preview                              */
/* ------------------------------------ */

#preview {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(0, calc(100%/3 - 10px)));
    width: calc(100% + 10px);
    margin: 30px 0 20px 0;
}
#preview .preview-item {
    display: flex;
    flex-direction: column;
    border: solid 1px #333;
    position: relative;
    cursor: pointer;
}
#preview .preview-item img {
    margin-bottom: auto;
    width: 100%;
}
#preview .preview-item[data-file=pdf] {
    min-height: 160px;
}
#preview .preview-item[data-file=pdf] img {
    margin: auto;
    width: 40%;
}
#preview .preview-item[data-file=pdf] {
    pointer-events: none;
}
#preview .preview-item[data-file=pdf]:after {
    display: none;
}
#preview .preview-item .preview-title {
    background-color: #333;
    color: #fff;
    text-align: center;
}

#preview .preview-item:after {
    content: url(../img/icon-zoom.png);
    position: absolute;
    top: 0px;
    right: 1px;
    display: block;
    width: 32px;
    height: 24px;
}

/* ------------------------------------ */
/* Lightbox                             */
/* ------------------------------------ */

body.modal-open {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    height: 100dvh;
    width: 100dvw;
}

#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(120,120,120,1.0);
    width: 100vw;
    height: 100vh;
    width: 100dvw;
    height: 100dvh;
}
#lightbox .close {
    position: absolute;
    right: 0px;
    top: 0px;
    padding: 10px;
    background-color: #333;
    cursor: pointer;
    width: 24px;
    height: 24px;
    z-index: 999;
}
#lightbox .close img {
    width: 24px;
    height: 24px;
}
#lightbox .preview-item {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}
#lightbox .preview-item .wrapper {
    height: calc(100vh - 31px);
    width: 100vw;
    height: calc(100dvh - 31px);
    width: 100dvw;
    margin: auto;
}
#lightbox .preview-item img {
    height: 100%;
}
#lightbox .preview-item[data-file=pdf] img {
    margin: auto;
    width: 200px;
}
#lightbox .preview-item .preview-title {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 5px;
}