:root {
    --portal-bg: #050505;
    --portal-surface: #ffffff;
    --portal-surface-soft: #f5f5f5;
    --portal-text: #111111;
    --portal-muted: #5f6368;
    --portal-line: rgba(17, 17, 17, 0.08);
    --portal-shadow: 0 22px 60px rgba(0, 0, 0, 0.16);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Barlow", sans-serif;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.1), transparent 24%),
        linear-gradient(180deg, #050505 0%, #101010 32%, #f4f4f4 32%, #f7f7f7 100%);
    color: var(--portal-text);
}

body.portal-entry-body {
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

.portal-entry-shell {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: 18px 0 40px;
}

.portal-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.portal-entry-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #ffffff;
}

.portal-entry-brand img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    padding: 8px;
}

.portal-entry-brand strong,
.portal-entry-brand span {
    display: block;
}

.portal-entry-brand strong {
    font-size: 1rem;
    font-weight: 800;
}

.portal-entry-brand span {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.68);
}

.portal-entry-header-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
}

.portal-entry-main {
    display: grid;
    gap: 22px;
}

.portal-hero,
.portal-install-card,
.portal-benefits,
.portal-flow {
    border-radius: 32px;
    box-shadow: var(--portal-shadow);
}

.portal-hero {
    display: grid;
    gap: 26px;
    padding: 26px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.portal-kicker,
.portal-section-label,
.portal-flow__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: #111111;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.portal-hero__copy h1,
.portal-benefits__intro h2,
.portal-install-card__header h2,
.portal-flow__content h2 {
    margin: 14px 0 12px;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
}

.portal-hero__copy p,
.portal-benefits__intro p,
.portal-install-card__header p,
.portal-flow__content p,
.portal-benefits__grid p,
.portal-flow__panel li {
    margin: 0;
    color: var(--portal-muted);
    line-height: 1.7;
    font-size: 1rem;
}

.portal-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.portal-hero__badges span {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: #f4f4f4;
    border: 1px solid var(--portal-line);
    font-size: 0.92rem;
    font-weight: 700;
}

.portal-hero__actions,
.portal-install-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.portal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 22px;
    border-radius: 18px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.98rem;
    font-weight: 800;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.portal-button:hover {
    transform: translateY(-1px);
}

.portal-button--primary {
    background: #111111;
    color: #ffffff;
    box-shadow: 0 14px 32px rgba(17, 17, 17, 0.22);
}

.portal-button--secondary,
.portal-button--ghost {
    background: #ffffff;
    color: #111111;
    border-color: var(--portal-line);
}

.portal-hero__note {
    margin-top: 14px;
    color: var(--portal-muted);
    font-size: 0.95rem;
}

.portal-device {
    display: flex;
    justify-content: center;
}

.portal-device__frame {
    width: min(100%, 360px);
    padding: 12px;
    border-radius: 36px;
    background: linear-gradient(180deg, #111111 0%, #1d1d1f 100%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.portal-device__topbar {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 2px 0 14px;
}

.portal-device__topbar span {
    width: 34px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
}

.portal-device__screen {
    min-height: 480px;
    padding: 18px;
    border-radius: 26px;
    background:
        radial-gradient(circle at top right, rgba(17, 17, 17, 0.08), transparent 22%),
        linear-gradient(180deg, #fafafa 0%, #f2f2f2 100%);
    display: grid;
    gap: 16px;
}

.portal-device__mini-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-device__mini-brand img {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: #111111;
    padding: 8px;
}

.portal-device__mini-brand strong,
.portal-device__mini-brand span {
    display: block;
}

.portal-device__mini-brand strong {
    font-weight: 800;
}

.portal-device__mini-brand span {
    color: var(--portal-muted);
    font-size: 0.86rem;
}

.portal-device__hero-card {
    padding: 18px;
    border-radius: 24px;
    background: #111111;
    color: #ffffff;
}

.portal-device__hero-card small {
    display: block;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 10px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.portal-device__hero-card strong {
    font-size: 1.3rem;
    line-height: 1.15;
}

.portal-device__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.portal-device__grid article {
    padding: 14px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid rgba(17, 17, 17, 0.06);
}

.portal-device__grid small,
.portal-device__grid span {
    display: block;
}

.portal-device__grid small {
    color: var(--portal-muted);
    font-size: 0.78rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.portal-device__grid strong {
    font-size: 1.05rem;
    line-height: 1.2;
}

.portal-device__grid span {
    color: var(--portal-muted);
    margin-top: 6px;
    font-size: 0.84rem;
}

.portal-install-card,
.portal-benefits,
.portal-flow {
    padding: 24px;
    background: #ffffff;
    border: 1px solid rgba(17, 17, 17, 0.06);
}

.portal-install-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.portal-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: #f3f4f6;
    border: 1px solid var(--portal-line);
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
}

.portal-status-chip.is-ready {
    background: #111111;
    color: #ffffff;
}

.portal-status-chip.is-manual {
    background: #f4f4f5;
    color: #111111;
}

.portal-status-chip.is-installed {
    background: #e8f7ec;
    color: #146534;
    border-color: rgba(20, 101, 52, 0.18);
}

.portal-instructions {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.portal-instructions[hidden] {
    display: none;
}

.portal-instruction-card {
    padding: 18px;
    border-radius: 22px;
    background: #f7f7f8;
    border: 1px solid rgba(17, 17, 17, 0.06);
}

.portal-instruction-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
}

.portal-instruction-card p {
    margin: 0;
    color: var(--portal-muted);
    line-height: 1.65;
}

.portal-steps {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.portal-step {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.portal-step__index {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: #111111;
    color: #ffffff;
    font-weight: 800;
}

.portal-step__body strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.96rem;
}

.portal-step__body p {
    margin: 0;
    color: var(--portal-muted);
    line-height: 1.6;
}

.portal-benefits {
    display: grid;
    gap: 18px;
}

.portal-benefits__grid {
    display: grid;
    gap: 12px;
}

.portal-benefits__grid article {
    padding: 20px;
    border-radius: 24px;
    background: linear-gradient(180deg, #111111 0%, #1b1b1d 100%);
    color: #ffffff;
}

.portal-benefits__grid strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.08rem;
}

.portal-benefits__grid p {
    color: rgba(255, 255, 255, 0.7);
}

.portal-flow {
    display: grid;
    gap: 18px;
}

.portal-flow__steps {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.portal-flow__steps div,
.portal-flow__panel {
    padding: 18px;
    border-radius: 24px;
    background: #f6f6f7;
    border: 1px solid rgba(17, 17, 17, 0.06);
}

.portal-flow__steps strong {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: #111111;
    color: #ffffff;
    font-size: 0.94rem;
}

.portal-flow__steps span {
    display: block;
    color: var(--portal-text);
    font-weight: 600;
    line-height: 1.5;
}

.portal-flow__panel ul {
    margin: 14px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 10px;
}

.portal-noscript {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #ffffff;
    color: #111111;
    box-shadow: var(--portal-shadow);
    text-align: center;
    font-weight: 700;
}

body.is-installed .portal-button--primary[data-mode="install"] {
    display: none;
}

@media (min-width: 880px) {
    .portal-entry-shell {
        width: min(1240px, calc(100% - 52px));
        padding-top: 26px;
        padding-bottom: 64px;
    }

    .portal-hero {
        grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.72fr);
        align-items: center;
        padding: 34px;
    }

    .portal-benefits__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .portal-flow {
        grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
        align-items: start;
    }
}
