/* Sign-in page */

:root {
    --ink: #202938;
    --muted: #7c8796;
    --line: #dfe4eb;
    --blue: #2878e8;
    --error-bg: #fdecec;
    --error-ink: #a12a2a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg-f3f5f8);
    color: var(--ink);
    font: 14px 'Segoe UI', Arial, sans-serif;
    -webkit-user-select: none;
    user-select: none;
}

/* Only what is typed into can be selected, as on the desktop (base.css). */
input {
    -webkit-user-select: text;
    user-select: text;
}

.login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.hero {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 9%;
    background: linear-gradient(140deg, var(--bg-12233d), var(--bg-1e4c7d));
    color: var(--fg-ffffff);
}

.hero h1 {
    font-size: 42px;
    line-height: 1.1;
}

.hero p {
    max-width: 420px;
    color: var(--fg-c0d2e8);
}

.brand {
    font-size: 16px;
    font-weight: 700;
}

.logo {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-right: 9px;
    border-radius: 8px;
    background: var(--blue);
    color: var(--fg-ffffff);
}

.form-side {
    display: grid;
    place-items: center;
}

.loginform {
    width: min(380px, 85%);
    margin: auto;
}

.loginform h2 {
    font-size: 27px;
}

/* The greeting types itself (login.js). The caret is not in the line until the script shows it, and stays solid while keys are being pressed, as a real one does. */
.caret {
    display: none;
    margin-left: 1px;
}

.caret.shown {
    display: inline;
    animation: caret-blink 1.06s steps(1, end) infinite;
}

.caret.shown.typing {
    animation: none;
}

/* The last blink: on for its first half, then off for good. The animation starts at the moment the cursor has just come on (login.js), and its end state is kept, so the cursor goes out without a flash. */
.caret.shown.rested {
    animation: caret-off 1.06s steps(1, end) 1 forwards;
}

@keyframes caret-blink {
    50% {
        opacity: 0;
    }
}

@keyframes caret-off {
    50%,
    100% {
        opacity: 0;
    }
}

.ico {
    position: absolute;
    transform: translateY(-100%);
    display: inline-grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border-radius: 9px;
    background: var(--bg-eaf2ff);
    color: var(--blue);
    font-size: 19px;
}

.muted {
    color: var(--muted);
    font-size: 12px;
}

.field {
    margin: 16px 0;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
}

input,
button {
    font: inherit;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--bg-ffffff);
}

.field input {
    width: 100%;
}

button {
    width: 100%;
    cursor: pointer;
}

button.primary {
    border-color: var(--blue);
    background: var(--blue);
    color: var(--fg-ffffff);
}

button.primary:disabled {
    opacity: .6;
    cursor: default;
}

.error {
    display: none;
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 7px;
    background: var(--error-bg);
    color: var(--error-ink);
    font-size: 13px;
}

.error.show {
    display: block;
}

@media (max-width: 650px) {
    .login {
        grid-template-columns: 1fr;
    }

    .hero {
        display: none;
    }
}

.info {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 7px;
    background: var(--bg-eef4ff);
    color: var(--fg-355f9f);
    font-size: 13px;
}

.info[hidden] {
    display: none;
}

/* ---- Between this page and the desktop ----
   Which parts take part is named here (the old page's snapshot); how they animate is in transition.css, which the desktop loads too. */

.hero {
    view-transition-name: login-hero;
}

.form-side {
    view-transition-name: login-form;
}
