:root {
    --bg: #ffffff;
    --ink: #151313;
    --ink-dim: #6f6a63;
    --red: #a3161c;
    --red-hover: #c21f26;
    --focus: #c21f26;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    font-family: 'Archivo', sans-serif;
    overflow: hidden;
}

body {
    position: relative;
    width: 100%;
    height: 100vh;
}

#viewport {
    position: fixed;
    inset: 0;
}

/* ===== the two panels that split apart ===== */
.panel {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 50%;
    background: var(--bg);
    z-index: 30;
    transition: transform .85s cubic-bezier(.77, 0, .16, 1);
    will-change: transform;
}

.panel-left {
    left: 0;
    transform: translateX(0%);
}

.panel-right {
    right: 0;
    transform: translateX(0%);
}

body.open .panel-left {
    transform: translateX(-100%);
}

body.open .panel-right {
    transform: translateX(100%);
}

/* ===== logo / stage sitting on top of the panels ===== */
.stage {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.rig {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-wrap {
    position: relative;
    width: min(44vw, 320px);
    height: min(44vw, 320px);
}

.logo-half {
    position: absolute;
    inset: 0;
    overflow: hidden;
    transition:
        transform .85s cubic-bezier(.77, 0, .16, 1),
        opacity .4s ease .85s;
}

.logo-half img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    animation: spin 16s linear infinite;
    filter: drop-shadow(0 0 24px rgba(163, 22, 28, .16));
    transition: animation-duration .4s ease, filter .4s ease;
}

.logo-half.left {
    clip-path: inset(0 50% 0 0);
}

.logo-half.right {
    clip-path: inset(0 0 0 50%);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

body.open .stage {
    pointer-events: none;
}

body.open .logo-half {
    transition:
        transform .85s cubic-bezier(.77, 0, .16, 1),
        opacity .3s ease;
}

body.open .logo-half img {
    animation-duration: 2.2s;
}

body.open .logo-half.left {
    transform: translateX(-70%);
    opacity: 0;
}

body.open .logo-half.right {
    transform: translateX(70%);
    opacity: 0;
}

/* ===== login sitting behind, revealed by the split ===== */
.backstage {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.login {
    width: min(90vw, 380px);
    text-align: center;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .5s ease .35s, transform .5s ease .35s;
    pointer-events: none;
}

body.open .login {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.login .eyebrow {
    font-size: 11px;
    letter-spacing: .35em;
    text-transform: uppercase;
    color: var(--red);
    margin: 0 0 8px;
}

.login-logo {
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
}

.login-logo img {
    width: 100%;
    height: 100%;
    display: block;
    animation: spin 2.4s linear infinite;
}

.login h1 {
    font-family: 'Anton', sans-serif;
    font-weight: 400;
    font-size: clamp(20px, 3.4vw, 26px);
    letter-spacing: .02em;
    color: var(--ink);
    margin: 0 0 28px;
    text-transform: uppercase;
}

.field {
    text-align: left;
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 11px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-dim);
    margin-bottom: 7px;
}

.field input {
    width: 100%;
    padding: 13px 14px;
    background: rgba(21, 19, 19, .035);
    border: 1px solid rgba(21, 19, 19, .15);
    border-radius: 2px;
    color: var(--ink);
    font-family: 'Archivo', sans-serif;
    font-size: 15px;
    outline: none;
    transition: border-color .2s ease, background .2s ease;
}

.field input::placeholder {
    color: rgba(111, 106, 99, .5);
}

.field input:focus {
    border-color: var(--focus);
    background: rgba(21, 19, 19, .05);
    box-shadow: 0 0 0 3px rgba(194, 31, 38, .18);
}

.field-error {
    font-size: 12px;
    color: var(--red-hover);
    margin: 6px 0 0;
}

.row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2px 0 26px;
    font-size: 12.5px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-dim);
}

.remember input {
    accent-color: var(--red);
}

.row-between a {
    color: var(--ink-dim);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.row-between a:hover {
    color: var(--red-hover);
    border-color: var(--red-hover);
}

.submit {
    width: 100%;
    padding: 14px;
    background: var(--red);
    border: none;
    border-radius: 2px;
    color: #fff;
    font-family: 'Anton', sans-serif;
    letter-spacing: .1em;
    font-size: 15px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s ease, transform .15s ease;
}

.submit:hover {
    background: var(--red-hover);
}

.submit:active {
    transform: scale(.98);
}

.switch {
    margin-top: 22px;
    font-size: 13px;
    color: var(--ink-dim);
}

.switch a {
    color: var(--red-hover);
    text-decoration: none;
    border-bottom: 1px solid rgba(194, 31, 38, .4);
}

.switch a:hover {
    border-color: var(--red-hover);
}

@media (prefers-reduced-motion: reduce) {

    .logo-half img,
    .panel,
    .login,
    .logo-half {
        transition: none;
        animation: none;
    }
}

@media (hover:none) {
    .stage::after {
        content: 'Toca para entrar';
        position: absolute;
        bottom: 14%;
        font-size: 11px;
        letter-spacing: .3em;
        text-transform: uppercase;
        color: var(--ink-dim);
        opacity: .6;
    }
}
