:root {
    --toptri-blue: #2f62ff;
    --toptri-blue-hover: #2450d6;
    --toptri-pink: #ff4f86;
    --toptri-green: #42ce83;
    --toptri-yellow: #ffcc33;
    --toptri-ink: #14204a;
    --toptri-ink-soft: #5a678c;
    --toptri-line: #e8ebf3;
    --toptri-surface: #ffffff;

    /*
     * base.css styles its own pages (login, account, password) from these tokens and
     * does not define them itself, so the Top3 palette has to feed them. Without
     * --color-accent the base pages lose every accent colour.
     */
    --color-background: #f4f7ff;
    --color-surface: var(--toptri-surface);
    --color-text: var(--toptri-ink);
    --color-muted: var(--toptri-ink-soft);
    --color-border: var(--toptri-line);
    --color-accent: var(--toptri-blue);
    --color-accent-hover: var(--toptri-blue-hover);
}

/* base.css no longer ships a document reset: the shell stylesheet owns it. */
* {
    box-sizing: border-box;
}

body,
button,
input,
select,
textarea {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    margin: 0;
    color: var(--toptri-ink);
    background: linear-gradient(145deg, #f4f7ff, #fff9e9);
}

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

a:hover {
    color: var(--color-accent-hover);
}

.toptri-header {
    background: #fff;
    border-bottom: 1px solid #e8ebf3;
}

.toptri-nav {
    min-height: 68px;
    max-width: 70rem;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.toptri-brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--toptri-ink);
    text-decoration: none;
    font-size: 1.45rem;
}

.toptri-brand-mark {
    width: 30px;
    height: 27px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
}

.toptri-brand-mark i:first-child {
    border-radius: 50%;
    background: var(--toptri-blue);
}

.toptri-brand-mark i:nth-child(2) {
    border-radius: 50%;
    background: var(--toptri-pink);
}

.toptri-brand-mark i:last-child {
    width: 16px;
    grid-column: 1 / 3;
    justify-self: center;
    background: var(--toptri-green);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.toptri-actions {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.toptri-actions > a {
    color: var(--toptri-blue);
    font-weight: 700;
}

.toptri-actions > .toptri-account-link {
    width: 2.5rem;
    min-height: 2.5rem;
    border: 2px solid var(--toptri-blue);
    border-radius: 50%;
    display: grid;
    place-items: center;
    text-decoration: none;
}

.toptri-account-icon {
    width: 1.35rem;
    height: 1.35rem;
}

.toptri-locale {
    margin: 0;
    height: 40px;
    padding: 0 11px;
    border: 1px solid #e8ebf3;
    border-radius: 22px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--toptri-blue);
    background: #fff;
    position: relative;
}

.toptri-locale select {
    max-width: 87px;
    border: 0;
    outline: 0;
    color: var(--toptri-ink);
    background: transparent;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.toptri-locale-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    pointer-events: none;
}

.toptri-main {
    min-height: calc(100vh - 135px);
    padding: 2rem 1rem 4rem;
}

.toptri-shell {
    max-width: 48rem;
    margin: 0 auto;
}

.toptri-shell > div {
    padding: clamp(1.4rem, 5vw, 2.6rem);
    border: 1px solid #e5e8f2;
    border-radius: 1.75rem;
    background: #fff;
    box-shadow: 0 18px 50px rgba(30, 55, 130, .12);
}

.toptri-shell .button,
.toptri-shell button[type="submit"] {
    min-height: 3rem;
    border-radius: 1rem;
}

.toptri-shell .button-primary,
.toptri-shell button[type="submit"] {
    background: var(--toptri-blue);
}

.toptri-shell button.account-secondary-button[type="submit"] {
    color: #fff;
}

.toptri-footer {
    padding: 1.4rem;
    text-align: center;
}

.toptri-footer a {
    color: var(--toptri-blue);
    font-weight: 700;
}

@media (max-width: 760px) {
    .toptri-nav {
        padding-inline: .8rem;
    }

    .toptri-brand {
        font-size: 1.2rem;
    }

    .toptri-actions > a {
        font-size: .85rem;
    }

    .toptri-locale {
        width: 42px;
        padding: 0;
        justify-content: center;
    }

    .toptri-locale select {
        position: absolute;
        width: 42px;
        height: 42px;
        opacity: 0;
    }

    .toptri-main {
        padding: 1rem .6rem 2rem;
    }
}
