@font-face {
    font-family: "Figtree";
    src: url("fonts/figtree-latin-wght-normal.woff2") format("woff2");
    font-weight: 300 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #f5f6f7;
    --card: #ffffff;
    --fg: #141517;
    --fg-muted: #626873;
    --border: #caccd1;
    --border-hover: #81868f;
    --brand: #403af2;
    --accent: #0fd1c7;
    --error: #d7344c;
    --focus-ring: 0 0 0 3px rgba(64, 58, 242, 0.25);
    --button-from: #403af2;
    --button-to: #0fd1c7;
    --button-hover-from: #272381;
    --button-hover-to: #0fd1c7;
    --button-fg: #ffffff;
    --button-shadow: rgba(64, 58, 242, 0.35);
    --button-shadow-hover: rgba(64, 58, 242, 0.45);
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Orange of the GroupCMS logo. The label is dark, because white on the light orange has too little contrast. */
.theme-groupcms {
    --brand: #c4500c;
    --focus-ring: 0 0 0 3px rgba(224, 92, 16, 0.3);
    --button-from: #e05c10;
    --button-to: #ffa421;
    --button-hover-from: #f06a14;
    --button-hover-to: #ffb347;
    --button-fg: #141517;
    --button-shadow: rgba(224, 92, 16, 0.35);
    --button-shadow-hover: rgba(224, 92, 16, 0.45);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #08090a;
        --card: #141517;
        --fg: #ffffff;
        --fg-muted: #a1a4ab;
        --border: #3b3e45;
        --border-hover: #81868f;
        --brand: #0fd1c7;
        --error: #ff6b80;
        --focus-ring: 0 0 0 3px rgba(15, 209, 199, 0.35);
    }

    .theme-groupcms {
        --brand: #ffa421;
        --focus-ring: 0 0 0 3px rgba(255, 164, 33, 0.4);
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 16px;
    background: var(--bg);
    color: var(--fg);
    font-family: "Figtree", "Helvetica Neue", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

.card {
    width: 100%;
    max-width: 400px;
    padding: 40px 32px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08), 0 16px 32px rgba(0, 0, 0, 0.1);
}

.logo {
    margin-bottom: 24px;
    color: var(--fg);
}

.logo svg {
    display: block;
    width: auto;
    max-width: 100%;
}

.logo-dextinity svg {
    height: 40px;
}

.logo-groupcms svg {
    height: 28px;
}

h1 {
    margin: 0 0 4px;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.intro {
    margin: 0 0 24px;
    color: var(--fg-muted);
}

.alert {
    margin: 0 0 16px;
    padding: 12px 16px;
    border: 1.5px solid var(--error);
    border-radius: 8px;
    color: var(--error);
    font-size: 0.9375rem;
    font-weight: 500;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.label {
    font-size: 0.8125rem;
    font-weight: 600;
}

.input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--fg);
    font: inherit;
    transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.input:hover {
    border-color: var(--border-hover);
}

.input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--focus-ring);
}

.input-error {
    border-color: var(--error);
}

.button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 22px;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: transform 120ms var(--ease), box-shadow 200ms var(--ease), background 200ms var(--ease), color 200ms var(--ease);
}

.button:active {
    transform: translateY(1px);
}

.button:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.button-primary {
    background: linear-gradient(135deg, var(--button-from) 0%, var(--button-to) 100%);
    /* The gradient would otherwise start inside the transparent border and repeat in it, which shows the opposite color at the edges */
    background-origin: border-box;
    color: var(--button-fg);
    box-shadow: 0 8px 24px var(--button-shadow);
}

.button-primary:hover {
    background-image: linear-gradient(135deg, var(--button-hover-from) 0%, var(--button-hover-to) 100%);
    box-shadow: 0 12px 32px var(--button-shadow-hover);
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--fg-muted);
    font-size: 0.8125rem;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
