:root {
    --em-ink: #092445;
    --em-muted: #68798c;
    --em-line: #d6ebfb;
    --em-soft: #eef9ff;
    --em-sky: #18a8ff;
    --em-blue: #0758c8;
    --em-navy: #05264a;
    --em-card: #ffffff;
    --em-shadow: 0 22px 54px rgba(7, 88, 200, .15);
    --em-bottom-safe: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body.em-body {
    min-height: 100dvh;
    color: var(--em-ink);
    background:
        radial-gradient(circle at 18% 5%, rgba(56, 189, 248, .24), transparent 280px),
        radial-gradient(circle at 90% 12%, rgba(14, 165, 233, .18), transparent 280px),
        linear-gradient(180deg, #eaf8ff 0%, #f8fcff 52%, #ffffff 100%);
    font-family: "ZehnPro", Inter, "Segoe UI", Arial, sans-serif;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }

.em-shell {
    width: min(100vw, 414px);
    min-height: 100dvh;
    margin: 0 auto;
    padding: 12px 14px calc(86px + var(--em-bottom-safe));
    background:
        radial-gradient(circle at 18% 7%, rgba(255,255,255,.84), transparent 118px),
        linear-gradient(180deg, rgba(237, 250, 255, .92), #ffffff 42%);
    box-shadow: 0 0 0 1px rgba(7, 88, 200, .08), 0 22px 72px rgba(7, 88, 200, .14);
}

.em-topbar {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.em-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--em-ink);
}

.em-brand > span {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--em-sky), var(--em-blue));
    color: #fff;
    font-size: 14px;
    font-weight: 950;
    box-shadow: 0 10px 22px rgba(8, 119, 232, .22);
}

.em-brand strong {
    min-width: 0;
    display: grid;
    gap: 1px;
    overflow: hidden;
    color: var(--em-navy);
    font-size: 13px;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.em-brand small {
    color: var(--em-muted);
    font-size: 9.5px;
    font-weight: 800;
}

.em-topbar > a:last-child {
    min-height: 32px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    border: 1px solid rgba(168, 216, 255, .85) !important;
    border-radius: 12px;
    background: rgba(255,255,255,.78) !important;
    color: var(--em-blue);
    font-size: 11px;
    font-weight: 950;
}

.em-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 8px;
}

.em-copy,
.em-forms form,
.em-current,
.em-alert,
.em-auth-switch {
    border: 1px solid rgba(168, 216, 255, .84);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 12px 30px rgba(7, 88, 200, .08);
}

.em-copy {
    position: relative;
    min-height: 176px;
    overflow: hidden;
    padding: 18px 16px 15px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 100% 10%, rgba(255,255,255,.86), transparent 96px),
        linear-gradient(135deg, #c9f0ff 0%, #f4fbff 72%, #ffffff 100%);
}

.em-copy::after {
    content: "";
    position: absolute;
    right: -36px;
    bottom: -42px;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    border: 26px solid rgba(24, 168, 255, .11);
}

.em-copy-badge {
    position: relative;
    z-index: 1;
    width: max-content;
    min-height: 28px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    color: var(--em-blue);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.em-copy h1 {
    position: relative;
    z-index: 1;
    margin: 10px 0 6px;
    color: var(--em-navy);
    font-size: 25px;
    line-height: .98;
    font-weight: 950;
    letter-spacing: -.02em;
}

.em-copy p {
    position: relative;
    z-index: 1;
    max-width: 300px;
    margin: 0;
    color: #536b82;
    font-size: 12px;
    line-height: 1.38;
    font-weight: 700;
}

.em-benefit-stack {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.em-benefit-stack span {
    min-height: 27px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,.8);
    color: var(--em-navy);
    font-size: 10px;
    font-weight: 900;
}

.em-current {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-radius: 16px;
}

.em-current strong,
.em-current small { display: block; }
.em-current strong { font-size: 12px; color: var(--em-navy); }
.em-current small { color: var(--em-muted); font-size: 10px; font-weight: 800; }
.em-current button {
    min-height: 30px;
    border: 0;
    border-radius: 10px;
    padding: 0 10px;
    background: var(--em-navy);
    color: #fff;
    font-size: 10px;
    font-weight: 950;
}

.em-forms {
    display: grid;
    gap: 10px;
}

.em-alert {
    padding: 10px 12px;
    border-radius: 15px;
    background: #edfdf5;
    color: #0f7a5f;
    font-size: 11px;
    font-weight: 850;
}

.em-alert.error {
    background: #fff1f2;
    color: #be123c;
}

.em-auth-switch {
    padding: 5px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 17px;
}

.em-auth-switch button {
    min-height: 36px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--em-muted);
    font-size: 12px;
    font-weight: 950;
}

.em-auth-switch button.is-active {
    background: linear-gradient(135deg, var(--em-sky), var(--em-blue));
    color: #fff;
    box-shadow: 0 10px 22px rgba(8, 119, 232, .21);
}

.em-forms form[hidden] { display: none; }

.em-forms form {
    display: grid;
    gap: 10px;
    padding: 15px;
    border-radius: 22px;
}

.em-forms h2 {
    margin: 0;
    color: var(--em-navy);
    font-size: 18px;
    line-height: 1.05;
}

.em-form-note {
    margin: -4px 0 2px;
    color: var(--em-muted);
    font-size: 11px;
    line-height: 1.35;
    font-weight: 720;
}

.em-forms label {
    display: grid;
    gap: 5px;
}

.em-forms label span {
    color: var(--em-muted);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.em-forms input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--em-line);
    border-radius: 13px;
    padding: 0 12px;
    background: #fff;
    color: var(--em-ink);
    font-size: 13px;
    font-weight: 850;
    outline: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}

.em-forms input:focus {
    border-color: var(--em-sky);
    box-shadow: 0 0 0 3px rgba(24, 168, 255, .16);
}

.em-forms input.em-code {
    font-size: 20px;
    letter-spacing: .18em;
    text-align: center;
}

.em-forms form > button[type="submit"] {
    min-height: 44px;
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--em-sky), var(--em-blue));
    color: #fff;
    font-size: 13px;
    font-weight: 950;
    box-shadow: 0 13px 25px rgba(8, 119, 232, .24);
}

.em-switch {
    color: var(--em-blue);
    font-size: 11px;
    font-weight: 950;
    text-align: center;
}

@media (min-width: 860px) {
    .em-shell {
        width: min(920px, calc(100vw - 36px));
        min-height: auto;
        margin-top: 24px;
        border-radius: 28px;
        padding: 16px 16px 24px;
    }

    .em-panel {
        grid-template-columns: minmax(0, .86fr) minmax(330px, .74fr);
        align-items: start;
        gap: 14px;
    }

    .em-copy {
        min-height: 460px;
        align-content: end;
        padding: 28px;
    }

    .em-copy h1 {
        font-size: 44px;
    }

    .em-copy p {
        font-size: 14px;
    }
}

@media (max-width: 374px) {
    .em-shell { padding-left: 10px; padding-right: 10px; }
    .em-copy { padding: 15px 13px 13px; }
    .em-copy h1 { font-size: 23px; }
    .em-copy p { font-size: 11px; }
    .em-benefit-stack span { font-size: 9px; padding: 0 7px; }
    .em-forms form { padding: 13px; }
    .em-forms h2 { font-size: 16px; }
}

/* 2026-05-21: force loyalty member auth to stay mobile-device layout on desktop too */
@media (min-width: 860px) {
    .em-shell {
        width: min(100vw, 414px);
        min-height: 100dvh;
        margin-top: 0;
        border-radius: 0;
        padding: 12px 14px calc(86px + var(--em-bottom-safe));
    }

    .em-panel {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 12px;
    }

    .em-copy {
        min-height: 176px;
        align-content: normal;
        padding: 18px 16px 15px;
    }

    .em-copy h1 {
        font-size: 25px;
    }

    .em-copy p {
        font-size: 12px;
    }
}
