/* Login im neuen Design (siehe DESIGN.md).
   Handy: farbiger Kopf oben, Formular darunter.
   Ab 700 px: Kopf links, Formular rechts. */

html,
body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--fg);
    font-size: 16px;
    line-height: 1.35;
}

.login {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

/* ---------- Kopf ---------- */
.login__hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: max(44px, calc(env(safe-area-inset-top, 0px) + 28px)) 22px 30px;
    border-radius: 0 0 34px 34px;
    color: #ffffff;
    background: linear-gradient(150deg, #1fb6ee 0%, #3446d4 55%, #7a2fc0 100%);
    text-align: center;
}

/* Instanz mit eigener Farbe (KERWAGO_HEADER_COLOR), z. B. Test-Umgebung */
.login__hero--instanz {
    background: linear-gradient(150deg, var(--kerwago-header-color-light), var(--kerwago-header-color));
}

.login__logo {
    display: grid;
    place-items: center;
    width: 132px;
    height: 132px;
    margin-bottom: 6px;
    border-radius: 30px;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(20, 10, 80, 0.3);
}

.login__logo img {
    display: block;
    width: 112px;
    height: auto;
}

.login__title {
    max-width: 18ch;
    margin: 0;
    font-size: 2.125rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.login__title.brand-title-medium { font-size: 1.875rem; }
.login__title.brand-title-long { font-size: 1.625rem; }
.login__title.brand-title-xlong { font-size: 1.375rem; }

.login__subtitle {
    margin: 0;
    font-weight: 600;
    opacity: 0.9;
}

/* ---------- Formular ---------- */
.login__form-wrap {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.login__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 24px 20px;
}

.login__heading {
    margin: 0 4px;
    font-size: 1.375rem;
    letter-spacing: -0.01em;
}

.login__form .kw-flash {
    margin: 0;
}

.login__foot {
    margin: auto 0 0;
    padding: 20px 20px max(20px, env(safe-area-inset-bottom, 0px));
    color: var(--faint);
    font-size: 0.8125rem;
    text-align: center;
}

.login__status {
    display: inline-block;
    margin-right: 6px;
    vertical-align: 1px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ---------- Tablet / Desktop ---------- */
@media (min-width: 700px) {
    .login {
        flex-direction: row;
        min-height: 100vh;
    }

    .login__hero {
        flex: 1;
        justify-content: center;
        padding: 48px;
        border-radius: 0;
    }

    .login__logo {
        width: 168px;
        height: 168px;
        border-radius: 38px;
    }

    .login__logo img {
        width: 140px;
    }

    .login__title {
        font-size: 2.5rem;
    }

    .login__title.brand-title-medium { font-size: 2.125rem; }
    .login__title.brand-title-long { font-size: 1.875rem; }
    .login__title.brand-title-xlong { font-size: 1.625rem; }

    .login__form-wrap {
        position: relative;
        justify-content: center;
    }

    .login__form {
        max-width: 420px;
        padding: 48px;
    }

    .login__foot {
        position: absolute;
        right: 20px;
        bottom: 10px;
        left: 20px;
        margin: 0;
        padding: 0;
    }
}
