* {
    box-sizing: border-box;
}

:root {
    color-scheme: light dark;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    --primary: #5b3fd8;
    --primary-dark: #4328c4;
    --primary-soft: #eeeaff;
    --surface: rgba(255, 255, 255, 0.96);
    --surface-soft: #f8f7fc;
    --text: #211d2b;
    --text-muted: #6f6878;
    --border: rgba(91, 63, 216, 0.16);
    --shadow: 0 22px 60px rgba(43, 31, 97, 0.15);
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 0%,
            rgba(118, 87, 245, 0.22),
            transparent 34%),
        radial-gradient(circle at 100% 100%,
            rgba(80, 185, 255, 0.12),
            transparent 30%),
        linear-gradient(160deg,
            #f8f7fd 0%,
            #f1effb 100%);

    color: var(--text);
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding:
        max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
}

.card {
    position: relative;
    width: min(100%, 430px);
    padding: 18px;
    overflow: hidden;

    border:
        1px solid rgba(255, 255, 255, 0.72);

    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.top-glow {
    position: absolute;
    top: -95px;
    right: -80px;

    width: 210px;
    height: 210px;
    border-radius: 50%;

    background:
        radial-gradient(circle,
            rgba(91, 63, 216, 0.23),
            transparent 68%);

    pointer-events: none;
}

.brand-row {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;
    gap: 10px;

    padding-bottom: 15px;
    border-bottom:
        1px solid rgba(91, 63, 216, 0.10);
}

.app-logo {
    width: 43px;
    height: 43px;

    flex: 0 0 43px;
    object-fit: cover;

    border-radius: 13px;
    box-shadow:
        0 7px 18px rgba(62, 39, 178, 0.20);
}

.brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.brand-name {
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
}

.brand-tagline {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.invite-header {
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 18px 6px 0;
    text-align: center;
}

.invite-icon-wrap {
    width: 62px;
    height: 62px;

    display: grid;
    place-items: center;

    margin-bottom: 12px;
    border:
        1px solid rgba(91, 63, 216, 0.15);

    border-radius: 20px;

    background:
        linear-gradient(145deg,
            #f5f2ff,
            #e8e1ff);

    box-shadow:
        0 12px 24px rgba(91, 63, 216, 0.12);
}

.invite-icon {
    font-size: 31px;
    line-height: 1;
}

.badge {
    display: inline-flex;
    align-items: center;

    min-height: 25px;
    padding: 5px 10px;

    border-radius: 999px;
    background: var(--primary-soft);
    color: #4c35c9;

    font-size: 9.5px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.075em;
}

h1 {
    margin: 12px 0 6px;

    font-size: clamp(22px, 6vw, 29px);
    font-weight: 850;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.subtitle {
    max-width: 340px;
    margin: 0;

    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.55;
}

.invite-box {
    position: relative;
    z-index: 1;

    margin: 17px 0 0;
    padding: 13px 14px;

    border: 1px solid var(--border);
    border-radius: 15px;

    background:
        linear-gradient(135deg,
            rgba(248, 246, 255, 0.98),
            rgba(242, 239, 255, 0.98));

    text-align: center;
    overflow-wrap: anywhere;
}

.invite-label {
    display: block;
    margin-bottom: 4px;

    color: #777080;
    font-size: 9.5px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#inviteId {
    color: #4029b9;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.35;
}

.actions {
    position: relative;
    z-index: 1;
    margin-top: 16px;
}

.button {
    width: 100%;
    min-height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    margin-top: 9px;
    padding: 10px 14px;

    border: 0;
    border-radius: 14px;

    font: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;

    cursor: pointer;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        opacity 160ms ease;
}

.button:active {
    transform: scale(0.985);
}

.button-icon {
    font-size: 14px;
    line-height: 1;
}

.primary {
    background:
        linear-gradient(135deg,
            #684bf0,
            #4d30ce);

    color: #ffffff;

    box-shadow:
        0 11px 24px rgba(77, 48, 206, 0.24);
}

.primary:hover {
    box-shadow:
        0 14px 28px rgba(77, 48, 206, 0.30);
}

.secondary {
    border:
        1px solid rgba(91, 63, 216, 0.12);

    background: #eeeaff;
    color: #402ab7;
}

.text-button {
    min-height: 39px;
    margin-top: 4px;

    background: transparent;
    color: #5b3fd8;
    font-size: 12px;
}

.info-strip {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: flex-start;
    gap: 8px;

    margin-top: 12px;
    padding: 10px 11px;

    border-radius: 13px;
    background: var(--surface-soft);
}

.info-dot {
    width: 7px;
    height: 7px;

    flex: 0 0 7px;
    margin-top: 5px;

    border-radius: 50%;
    background: #5b3fd8;

    box-shadow:
        0 0 0 4px rgba(91, 63, 216, 0.10);
}

.help {
    margin: 0;
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.5;
}

.footer-text {
    margin: 10px 0 0;
    color: rgba(64, 55, 76, 0.58);
    font-size: 9.5px;
    font-weight: 700;
}

[hidden] {
    display: none !important;
}

@media (max-width: 390px) {
    .page {
        padding-left: 7px;
        padding-right: 7px;
    }

    .card {
        padding: 15px;
        border-radius: 21px;
    }

    .invite-header {
        padding-top: 15px;
    }

    .invite-icon-wrap {
        width: 56px;
        height: 56px;
        border-radius: 18px;
    }

    .invite-icon {
        font-size: 28px;
    }

    h1 {
        font-size: 22px;
    }

    .subtitle {
        font-size: 12px;
    }

    .button {
        min-height: 44px;
        font-size: 12.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .button {
        transition: none;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --surface: rgba(29, 27, 35, 0.97);
        --surface-soft: #26232d;
        --text: #f5f1fa;
        --text-muted: #bab2c2;
        --border: rgba(170, 149, 255, 0.22);
        --shadow:
            0 24px 65px rgba(0, 0, 0, 0.42);
    }

    body {
        background:
            radial-gradient(circle at 12% 0%,
                rgba(120, 85, 255, 0.20),
                transparent 34%),
            radial-gradient(circle at 100% 100%,
                rgba(42, 121, 173, 0.14),
                transparent 30%),
            #111015;
    }

    .card {
        border-color:
            rgba(255, 255, 255, 0.07);
    }

    .brand-row {
        border-bottom-color:
            rgba(255, 255, 255, 0.08);
    }

    .invite-icon-wrap {
        border-color:
            rgba(171, 153, 255, 0.20);

        background:
            linear-gradient(145deg,
                #332b52,
                #28223e);
    }

    .badge {
        background: #352b61;
        color: #d8ceff;
    }

    .invite-box {
        background:
            linear-gradient(135deg,
                #282332,
                #24202d);
    }

    .invite-label {
        color: #afa6b8;
    }

    #inviteId {
        color: #cfc2ff;
    }

    .secondary {
        border-color:
            rgba(167, 145, 255, 0.18);

        background: #342b5a;
        color: #e4ddff;
    }

    .text-button {
        color: #c5b7ff;
    }

    .info-dot {
        background: #a893ff;
    }

    .footer-text {
        color: rgba(235, 228, 243, 0.48);
    }
}