:root {
    --ink: #111111;
    --muted: #777777;
    --line: #dedede;
    --soft: #f6f6f6;
    --white: #ffffff;
    --danger: #c83e4d;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--white);
}

body {
    display: flex;
    min-height: 100vh;
    margin: 0;
    flex-direction: column;
    color: var(--ink);
    background: var(--white);
    font-family: "Inter", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
label,
a {
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

.header {
    position: relative;
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: var(--white);
    border-bottom: 1px solid #eeeeee;
}

.progress-bar {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: #eeeeee;
    overflow: hidden;
}

.progress-bar__line {
    width: 0;
    height: 100%;
    background: var(--ink);
    transition: width .25s ease, background-color .2s ease;
}

.header__logo a,
.header__logo {
    display: block;
    line-height: 0;
}

.header__logo-img {
    width: 42px;
    height: 42px;
}

.main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px;
}

.main--bg {
    display: flex;
    min-height: calc(100vh - 180px);
    flex: 1;
    align-items: center;
    justify-content: center;
}

.main-content {
    width: min(100%, 500px);
    margin: 0 auto;
    text-align: center;
}

.main-content__logo {
    margin-bottom: 16px;
    line-height: 0;
}

.main-content__logo-img {
    width: 96px;
    height: 96px;
}

.main-content__title {
    font-size: clamp(28px, 6vw, 38px);
    font-weight: 700;
    letter-spacing: .16em;
    line-height: 1.15;
}

.main-content__desc {
    max-width: 430px;
    margin: 12px auto 28px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 300;
    line-height: 1.6;
}

.main-form {
    display: grid;
    width: 100%;
    gap: 12px;
}

.main-form__files {
    display: flex;
    min-height: 140px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    padding: 24px;
    background: #fafafa;
    border: 1px dashed #bdbdbd;
    border-radius: 3px;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.main-form__files:hover,
.main-form__files.is-dragging {
    background: #f3f3f3;
    border-color: var(--ink);
}

.main-form__files.has-files {
    background: #f3f7f2;
    border-color: #789778;
}

.main-form__files-logo {
    width: 55px;
    height: 55px;
    transition: transform .18s ease;
}

.main-form__files:hover .main-form__files-logo {
    transform: translateY(-2px);
}

.main-form__files-text {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .03em;
}

.main-form__files input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.main-form__input {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 2px;
    outline: none;
    font-size: 13px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.main-form__input::placeholder {
    color: #a2a2a2;
}

.main-form__input:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, .06);
}

.main-form__checkboxes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 7px 0 3px;
}

.main-form__checkbox {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 9px;
    color: #555555;
    cursor: pointer;
    font-size: 12px;
    text-align: left;
}

.main-form__checkbox-check {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.main-form__checkbox-box {
    position: relative;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    background: var(--white);
    border: 1px solid #bcbcbc;
    border-radius: 2px;
    transition: background .15s ease, border-color .15s ease;
}

.main-form__checkbox-check:checked + .main-form__checkbox-box {
    background: var(--ink);
    border-color: var(--ink);
}

.main-form__checkbox-check:checked + .main-form__checkbox-box::after {
    position: absolute;
    top: 3px;
    left: 6px;
    width: 4px;
    height: 8px;
    content: "";
    border-right: 2px solid var(--white);
    border-bottom: 2px solid var(--white);
    transform: rotate(45deg);
}

.main-form__checkbox-check:focus-visible + .main-form__checkbox-box {
    box-shadow: 0 0 0 3px rgba(17, 17, 17, .12);
}

.main-form__button {
    width: 100%;
    height: 54px;
    margin-top: 4px;
    color: var(--white);
    background: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 2px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.main-form__button:hover {
    color: var(--ink);
    background: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, .10);
}

.main-form__button:active {
    transform: translateY(0);
}

.main-form__button:focus-visible,
.local-captcha__submit:focus-visible,
.local-captcha__cancel:focus-visible,
.local-captcha__refresh:focus-visible {
    outline: 3px solid rgba(17, 17, 17, .18);
    outline-offset: 2px;
}

.footer {
    padding: 20px clamp(20px, 5vw, 70px) 28px;
    color: #969696;
    background: var(--white);
    font-size: 10px;
    line-height: 1.65;
    text-align: center;
}

.footer__text {
    max-width: 1050px;
    margin: 0 auto;
}

.footer a {
    color: #555555;
}

.upload-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 22px;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(5px);
}

.upload-overlay__img {
    width: 82px;
    height: 82px;
    animation: logo-pulse 1.35s ease-in-out infinite;
}

.load {
    display: flex;
    height: 38px;
    align-items: flex-end;
    gap: 5px;
}

.load hr {
    width: 4px;
    height: 14px;
    margin: 0;
    background: var(--ink);
    border: 0;
    animation: loader-bar .8s ease-in-out infinite alternate;
}

.load hr:nth-child(2) { animation-delay: .15s; }
.load hr:nth-child(3) { animation-delay: .3s; }
.load hr:nth-child(4) { animation-delay: .45s; }

@keyframes loader-bar {
    to { height: 38px; }
}

@keyframes logo-pulse {
    50% { opacity: .55; transform: scale(.94); }
}

.local-captcha-dialog {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(8, 8, 8, .64);
    backdrop-filter: blur(5px);
}

.local-captcha-card {
    width: min(100%, 365px);
    padding: 25px;
    color: var(--ink);
    background: var(--white);
    border-radius: 4px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, .3);
}

.local-captcha-card h2 {
    margin: 0 0 7px;
    font-size: 20px;
}

.local-captcha-card > p {
    margin: 0 0 17px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.local-captcha__visual {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

.local-captcha__image {
    display: block;
    width: 220px;
    max-width: calc(100% - 48px);
    height: 70px;
    background: #f3f6fb;
    border: 1px solid var(--line);
    border-radius: 3px;
}

.local-captcha__refresh {
    display: grid;
    width: 39px;
    height: 39px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 2px;
    font-size: 20px;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, color .2s ease;
}

.local-captcha__refresh:hover {
    color: var(--white);
    background: var(--ink);
    transform: rotate(30deg);
}

.local-captcha__input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 2px;
    outline: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.local-captcha__input:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, .07);
}

.local-captcha__error {
    min-height: 18px;
    margin-top: 7px;
    color: var(--danger);
    font-size: 11px;
}

.local-captcha__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.local-captcha__cancel,
.local-captcha__submit {
    min-width: 92px;
    height: 42px;
    padding: 0 14px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.local-captcha__cancel {
    color: #555555;
    background: var(--soft);
    border: 1px solid var(--line);
}

.local-captcha__submit {
    color: var(--white);
    background: var(--ink);
    border: 1px solid var(--ink);
}

/* Viewer pages */
.header__wrapper {
    width: min(100%, 1200px);
    margin: 0 auto;
}

.header__link {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header__link-logo__img {
    width: 38px;
    height: 38px;
}

.header__link-code {
    min-width: 0;
    flex: 1;
    margin: 0;
    overflow: hidden;
    color: #777777;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header__link-copy {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 2px;
    cursor: pointer;
}

.header__link-copy svg {
    width: 18px;
    height: 18px;
}

.main-results {
    display: flex;
    min-height: calc(100vh - 210px);
    align-items: center;
    justify-content: center;
    text-align: center;
}

.main-results img,
.main-results video {
    display: block;
    max-width: 100%;
    max-height: 72vh;
    margin: auto;
    object-fit: contain;
}

@media (max-width: 600px) {
    .header {
        min-height: 62px;
    }

    .header__logo-img {
        width: 36px;
        height: 36px;
    }

    .main {
        padding: 25px 16px;
    }

    .main--bg {
        align-items: flex-start;
    }

    .main-content__logo-img {
        width: 80px;
        height: 80px;
    }

    .main-content__desc {
        margin-bottom: 22px;
    }

    .main-form__checkboxes {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .main-form__files {
        min-height: 125px;
    }

    .footer {
        padding-inline: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
