:root {
    --i4-night: #07111f;
    --i4-ink: #081a2f;
    --i4-blue: #0878e6;
    --i4-blue-dark: #0562bd;
    --i4-cyan: #45c2ff;
    --i4-cloud: #f4f7fb;
    --i4-line: #dbe5ef;
    --brand: var(--i4-blue);
    color-scheme: light;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--i4-cloud);
    color: var(--i4-ink);
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: clamp(24px, 7vh, 72px) 20px;
    background:
        radial-gradient(circle at 14% 0%, color-mix(in srgb, var(--brand) 15%, transparent), transparent 28rem),
        radial-gradient(circle at 90% 12%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 30rem),
        linear-gradient(145deg, #f8fbff 0%, #eaf1f9 100%);
}

.service-shell {
    display: grid;
    width: min(760px, 100%);
    gap: 18px;
    margin: 0 auto;
}

.service-header,
.service-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-inline: 4px;
}

.service-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--i4-night);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.11em;
    text-decoration: none;
    text-transform: uppercase;
}

.service-brand img {
    display: block;
    width: auto;
    height: auto;
    max-width: 174px;
    max-height: 64px;
}

.service-brand span {
    padding-left: 14px;
    border-left: 1px solid rgb(8 26 47 / 18%);
}

.service-assurance {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4b6078;
    font-size: 0.78rem;
    font-weight: 750;
}

.service-assurance > span {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    background: var(--i4-night);
    color: #fff;
    font-size: 0.75rem;
}

.service-content {
    width: 100%;
}

.service-footer {
    color: #64748a;
    font-size: 0.75rem;
    font-weight: 650;
}

.auth-card,
main {
    width: min(460px, 100%);
    margin: 0 auto;
    padding: clamp(28px, 6vw, 44px);
    overflow: hidden;
    background: rgb(255 255 255 / 96%);
    border: 1px solid rgb(18 45 82 / 12%);
    border-radius: 24px;
    box-shadow: 0 28px 80px rgb(8 26 47 / 14%);
    isolation: isolate;
    position: relative;
}

.auth-card::before,
main::before {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    left: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--brand, var(--i4-blue)), var(--i4-cyan));
    content: "";
}

.connection-card {
    width: min(680px, 100%);
}

.auth-header {
    margin-bottom: 30px;
    text-align: center;
}

.auth-header--compact {
    margin-bottom: 22px;
}

.auth-header--compact h1 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.2;
}

.auth-header--left {
    text-align: left;
}

header img {
    max-width: 180px;
    max-height: 64px;
}

.brand-lockup {
    margin-bottom: 30px;
}

.brand-lockup img {
    display: block;
    width: 190px;
    max-width: 52%;
    height: auto;
}

h1 {
    margin: 8px 0 10px;
    font-size: clamp(2rem, 4.5vw, 2.55rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: var(--i4-night);
}

p {
    line-height: 1.55;
}

.auth-header p {
    margin: 0;
    color: #5c687a;
    font-size: 1.05rem;
}

.eyebrow {
    color: var(--brand, var(--i4-blue));
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

label {
    display: grid;
    gap: 8px;
    margin: 18px 0;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #b8c8d8;
    border-radius: 12px;
    background: #f9fbfd;
    color: inherit;
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand, var(--i4-blue));
    background: #fff;
    outline: 3px solid color-mix(in srgb, var(--brand, var(--i4-blue)) 18%, transparent);
}

button,
.button {
    display: inline-flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    padding: 13px 20px;
    border: 0;
    border-radius: 999px;
    background: var(--brand, var(--i4-blue));
    box-shadow: 0 10px 24px color-mix(in srgb, var(--brand, var(--i4-blue)) 28%, transparent);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

button:hover,
.button:hover {
    box-shadow: 0 14px 30px color-mix(in srgb, var(--brand, var(--i4-blue)) 34%, transparent);
    transform: translateY(-1px);
}

button:focus-visible,
.button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--brand, var(--i4-blue)) 28%, transparent);
    outline-offset: 3px;
}

button:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.connection-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 22px;
}

.connection-details > div {
    min-width: 0;
    padding: 17px 18px;
    background: var(--i4-cloud);
    border: 1px solid var(--i4-line);
    border-radius: 16px;
}

.connection-details__wide {
    grid-column: 1 / -1;
}

.connection-details dt {
    margin-bottom: 5px;
    color: #5a6f86;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.connection-details dd {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 720;
}

code {
    overflow-wrap: anywhere;
    color: #0b4e7d;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.9em;
}

.security-note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 0 0 26px;
    padding: 15px 17px;
    background: #edf7ff;
    border: 1px solid #cce5fa;
    border-radius: 16px;
    color: #174d78;
}

.security-note p {
    margin: 0;
}

.security-note__icon {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--brand, var(--i4-blue));
    color: #fff;
    font-size: 0.8rem;
    font-weight: 900;
}

.form-help {
    margin: 11px 0 0;
    color: #718078;
    font-size: 0.82rem;
    text-align: center;
}

.auth-return {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--i4-line);
    text-align: center;
}

.auth-return a {
    color: #4d5d70;
    font-weight: 750;
    text-decoration: none;
}

.auth-return a:hover {
    color: var(--brand, var(--i4-blue));
    text-decoration: underline;
}

.alternate-action {
    margin-top: 28px;
    padding: 18px;
    background: var(--i4-cloud);
    border: 1px solid var(--i4-line);
    border-radius: 16px;
}

.alternate-action p {
    margin: 5px 0 14px;
    color: #526980;
}

.button--secondary {
    background: #edf6ff;
    box-shadow: none;
    color: var(--brand, var(--i4-blue));
}

.button--text {
    width: auto;
    min-height: 0;
    margin-top: 12px;
    padding: 4px 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--brand, var(--i4-blue));
    text-decoration: underline;
}

.button--text:hover {
    background: transparent;
    box-shadow: none;
    transform: none;
}

.account-choice {
    display: grid;
    gap: 5px;
    margin: 0 0 22px;
    padding: 17px 18px;
    background: var(--i4-cloud);
    border: 1px solid var(--i4-line);
    border-radius: 12px;
}

.account-choice span {
    color: #5a6f86;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.account-choice strong {
    overflow-wrap: anywhere;
    font-size: 1.05rem;
}

.account-choice__actions {
    display: grid;
    gap: 12px;
}

.security-section {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid var(--i4-line);
    border-radius: 13px;
    background: #fff;
}

.security-section h2,
.security-section p {
    margin-top: 0;
}

.security-section__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.security-section__heading p,
.security-section > p,
.security-list small,
.empty-state {
    color: #5a6f86;
}

.security-count {
    display: grid;
    min-width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 999px;
    background: #edf6ff;
    color: var(--brand, var(--i4-blue));
    font-weight: 800;
}

.security-list {
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.security-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--i4-line);
}

.security-list li > div {
    display: grid;
    gap: 3px;
}

.security-list form {
    margin: 0;
}

.button--danger {
    color: #9f241b;
}

.account-links {
    margin-top: 24px;
    text-align: center;
}

.account-links a {
    color: #4d5d70;
    font-weight: 750;
}

.notice {
    padding: 13px 15px;
    background: #edf7ff;
    border: 1px solid #cce5fa;
    border-radius: 10px;
    color: #174d78;
}

[role="alert"] {
    padding: 13px 15px;
    background: #fff1f0;
    border: 1px solid #f2c4bf;
    border-radius: 10px;
    color: #8b2922;
}

.factor-card {
    width: min(590px, 100%);
}

.factor-choice {
    margin: 14px 0;
    border: 1px solid var(--i4-line);
    border-radius: 13px;
    background: #fff;
    color: inherit;
}

.factor-choice[open] {
    border-color: color-mix(in srgb, var(--brand, var(--i4-blue)) 42%, var(--i4-line));
    box-shadow: 0 8px 24px rgb(8 78 130 / 10%);
}

.factor-choice > summary {
    display: flex;
    min-height: 74px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
}

.factor-choice > summary::-webkit-details-marker {
    display: none;
}

.factor-choice > summary span:first-child {
    display: grid;
    gap: 4px;
}

.factor-choice > summary small {
    color: #647269;
    font-size: 0.8rem;
    font-weight: 500;
}

.factor-choice__body {
    padding: 0 18px 18px;
    border-top: 1px solid #edf1ee;
}

.factor-choice__body > p:first-child {
    margin-top: 16px;
}

.factor-choice__body form {
    margin-top: 14px;
}

.authenticator-qr {
    display: grid;
    justify-items: center;
    gap: 10px;
    margin: 18px 0;
    text-align: center;
}

.authenticator-qr p {
    margin: 0;
}

.authenticator-qr img {
    display: block;
    width: min(260px, 100%);
    height: auto;
    padding: 10px;
    border: 1px solid var(--i4-line);
    border-radius: 12px;
    background: #fff;
}

.authenticator-fallback {
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid #e5ebe7;
    border-radius: 10px;
    background: #f8faf9;
}

.authenticator-fallback > summary {
    cursor: pointer;
    color: #294f70;
    font-weight: 700;
}

.authenticator-fallback code {
    overflow-wrap: anywhere;
}

.recovery-card {
    width: min(540px, 100%);
}

.recovery-code-list {
    display: grid;
    width: 100%;
    max-width: 100%;
    margin: 22px 0 14px;
    padding: 20px;
    overflow-x: hidden;
    border: 1px solid var(--i4-line);
    border-radius: 12px;
    background: var(--i4-cloud);
    box-sizing: border-box;
    color: var(--i4-ink);
    font-size: clamp(0.72rem, 2.2vw, 1rem);
    line-height: 1.8;
    letter-spacing: clamp(0.01em, 0.12vw, 0.05em);
    overflow-wrap: anywhere;
    text-align: center;
    user-select: all;
    white-space: pre-wrap;
    word-break: break-word;
}

.copyable-value {
    position: relative;
    cursor: copy;
    isolation: isolate;
}

.copyable-value::after {
    content: attr(data-copy-label);
    position: absolute;
    z-index: 2;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 10px;
    border-radius: inherit;
    background: color-mix(in srgb, var(--brand, var(--i4-blue)) 92%, transparent);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    transition: opacity 140ms ease;
}

.copyable-value:hover::after,
.copyable-value:focus-visible::after {
    opacity: 0.45;
}

.copyable-value[data-copy-state]::after {
    opacity: 1;
}

.copyable-value[data-copy-state="copied"]::after {
    content: attr(data-copied-label);
}

.copyable-value[data-copy-state="failed"]::after {
    content: "Copy failed";
    background: #b42318;
}

.copyable-value:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--brand, var(--i4-blue)) 48%, #fff);
    outline-offset: 3px;
}

.copyable-value--code {
    display: block;
    min-height: 44px;
    padding: 12px;
    border: 1px solid var(--i4-line);
    border-radius: 10px;
    background: var(--i4-cloud);
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

.screen-reader-status {
    position: fixed;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.recommended {
    padding: 5px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand, var(--i4-blue)) 12%, #fff);
    color: var(--brand, var(--i4-blue));
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.secret-value {
    padding: 15px;
    background: var(--i4-cloud);
    border: 1px dashed #9cb4ca;
    border-radius: 10px;
    font-size: 1.08rem;
    text-align: center;
}

details {
    margin: 14px 0 22px;
    color: #526980;
}

details code {
    display: block;
    margin-top: 10px;
}

.connection-complete {
    padding-block: clamp(42px, 8vw, 64px);
    text-align: center;
}

.success-mark {
    display: grid;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    place-items: center;
    border-radius: 50%;
    background: #e7f5eb;
    color: var(--brand, var(--i4-blue));
    font-size: 2rem;
    font-weight: 900;
}

@media (max-width: 560px) {
    body {
        padding: 16px;
    }

    .service-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .service-brand {
        width: 100%;
        justify-content: space-between;
    }

    .service-brand img {
        max-width: 150px;
    }

    .service-brand span {
        padding-left: 12px;
    }

    .service-assurance {
        font-size: 0.72rem;
    }

    .service-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .auth-card,
    main {
        padding: 26px 22px;
        border-radius: 16px;
    }

    .connection-details {
        grid-template-columns: 1fr;
    }

    .connection-details__wide {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
