/**
 * tibs design system - tokens and shared elements.
 *
 * Names follow the brandbook. The theme keeps its own copy until the shared
 * tokens package exists; after that this block is generated from it.
 * The legacy variables in main.css (--tibs-*, --bg-*, --radius-*, --color-*)
 * point at these, so the whole site moves together.
 */
:root {
    /* Surfaces and text */
    --ink: #0A0820;
    --sheet: #FFFFFF;
    --mist: #F4F5FA;
    --text: #14122E;
    --text-2: #6B6F8A;
    --text-3: #9A9CB2;
    --line: #E6E7EE;
    --line-strong: #DCDDE6;

    /* On Ink */
    --ink-text: #F0F2FA;
    --ink-text-2: rgba(240, 242, 250, 0.68);
    --ink-line: rgba(255, 255, 255, 0.14);
    --ink-panel: rgba(255, 255, 255, 0.05);

    /* Brand */
    --action: #3862F9;
    --action-hover: #2549C9;
    --link: #2549C9;
    --cobalt: #120899;
    --teal: #3bedcb;

    /* Products: colour for the dot, the badge and the icon; -text is the AA tone for text */
    --p-erp: #7948E5;   --p-erp-text: #5A2FC2;   --p-erp-tint: #F1ECFD;
    --p-chat: #2f9ae8;  --p-chat-text: #1579C2;  --p-chat-tint: #E8F4FD;
    --p-hub: #3bedcb;   --p-hub-text: #0C836C;   --p-hub-tint: #E4FBF6;
    --p-dna: #5DED9A;   --p-dna-text: #0F8641;   --p-dna-tint: #E7FBEF;
    --p-web: #13EADA;   --p-web-text: #0B8279;   --p-web-tint: #E2FBF9;
    --p-api: #3862F9;   --p-api-text: #2549C9;   --p-api-tint: #ECF0FE;
    --p-ngo: #DF4BEF;   --p-ngo-text: #C713DA;   --p-ngo-tint: #FCEBFD;
    --p-pos: #7948E5;   --p-pos-text: #5A2FC2;   --p-pos-tint: #F1ECFD;

    /* Meaning: text / background / mark */
    --ok: #0E7A4F;    --ok-bg: #E3F6EC;    --ok-mark: #16A36A;
    --warn: #8A5A00;  --warn-bg: #FFF3D6;  --warn-mark: #D98A00;
    --info: #2549C9;  --info-bg: #ECF0FE;  --info-mark: #3862F9;
    --mute: #3D4058;  --mute-bg: #EEEFF4;  --mute-mark: #6B6F8A;
    --bad: #B42318;   --bad-bg: #FDECEA;   --bad-mark: #D9422F;

    /* Shape */
    --r-sheet: 20px;
    --r-panel: 16px;
    --r-control: 10px;
    --r-status: 7px;

    /* Spacing step */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;

    /* Controls */
    --h-control: 40px;
    --h-control-sm: 32px;
    --h-control-lg: 48px;

    /* Type */
    --font: 'Acari Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* Motion */
    --t-fast: 150ms ease;
    --t-base: 250ms ease;

    /* Only floating things cast a shadow */
    --shadow-float: 0 18px 40px -24px rgba(10, 8, 32, 0.35), 0 0 0 1px var(--line);
    --focus-ring: 0 0 0 3px rgba(56, 98, 249, 0.28);
}

/* =============================================
   Focus
   ============================================= */
:focus-visible {
    outline: 2px solid var(--action);
    outline-offset: 2px;
}

/* =============================================
   Buttons
   Primary ("D"): Ink with an Azure square and an arrow. On Ink the button
   turns white and keeps the square.
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: var(--h-control);
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--r-control);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}

.btn-sm {
    height: var(--h-control-sm);
    padding: 0 12px;
    border-radius: 8px;
    font-size: 13px;
}

/* Large buttons are 48 only in a hero and in the demo block; 40 elsewhere. */
.btn-lg {
    font-size: 14px;
}

[class*="hero"] .btn-lg,
#demo .btn-lg,
.btn-xl {
    height: var(--h-control-lg);
    padding: 0 20px;
    font-size: 15px;
}

.btn-block,
.btn-full {
    width: 100%;
}

.btn-primary {
    background: var(--ink);
    color: #fff;
    padding-right: 6px;
}

.btn-primary::after {
    content: "";
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: var(--r-status);
    background: var(--action) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 16px no-repeat;
    transition: background-color var(--t-fast);
}

.btn-primary:hover {
    background: #1B1840;
    color: #fff;
}

.btn-primary:hover::after {
    background-color: var(--action-hover);
}

/* The square is the icon: an inline icon inside a primary button is dropped. */
.btn-primary > svg {
    display: none;
}

.btn-sm.btn-primary {
    padding-right: 5px;
}

.btn-sm.btn-primary::after {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background-size: 13px;
}

[class*="hero"] .btn-lg.btn-primary,
#demo .btn-lg.btn-primary,
.btn-xl.btn-primary {
    padding-right: 8px;
}

[class*="hero"] .btn-lg.btn-primary::after,
#demo .btn-lg.btn-primary::after,
.btn-xl.btn-primary::after {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-size: 18px;
}

.btn-block.btn-primary,
.btn-full.btn-primary {
    justify-content: space-between;
    padding-left: 20px;
}

/* Secondary: sheet with a line */
.btn-secondary,
.btn-white {
    background: var(--sheet);
    color: var(--text);
    border-color: var(--line-strong);
}

.btn-secondary:hover,
.btn-white:hover {
    background: var(--mist);
    color: var(--text);
}

/* Text button */
.btn-text {
    height: auto;
    padding: 0;
    background: transparent;
    color: var(--link);
}

.btn-text:hover {
    color: var(--cobalt);
}

/* Outline: the legacy secondary on dark surfaces */
.btn-outline,
.btn-outline-white {
    background: transparent;
    color: var(--ink-text);
    border-color: rgba(255, 255, 255, 0.28);
}

/* main.css loads later and gives .btn-outline dark text for light pages,
   so dark surfaces state the light text with a stronger selector. */
.on-ink .btn-outline,
[class*="hero"] .btn-outline {
    color: var(--ink-text);
    border-color: rgba(255, 255, 255, 0.28);
}

/* Light hover only where the surface is dark. */
.on-ink .btn-outline:hover,
[class*="hero"] .btn-outline:hover,
.site-header:not(.scrolled) .btn-outline:hover,
.btn-outline-white:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* On Ink: .on-ink on any dark block; heroes and the header over a hero are dark */
.on-ink .btn-primary,
[class*="hero"] .btn-primary,
.site-header:not(.scrolled) .btn-primary {
    background: #fff;
    color: var(--ink);
}

.on-ink .btn-primary:hover,
[class*="hero"] .btn-primary:hover,
.site-header:not(.scrolled) .btn-primary:hover {
    background: var(--ink-text);
    color: var(--ink);
}

.on-ink .btn-secondary,
.on-ink .btn-white {
    background: transparent;
    color: var(--ink-text);
    border-color: rgba(255, 255, 255, 0.28);
}

.on-ink .btn-secondary:hover,
.on-ink .btn-white:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.btn[disabled],
.btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =============================================
   Fields
   ============================================= */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field > label,
.field-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.input,
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
    width: 100%;
    height: var(--h-control);
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-control);
    background: var(--sheet);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.field textarea,
textarea.input {
    height: auto;
    min-height: 96px;
    padding: 10px 12px;
    line-height: 1.45;
}

.input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
    color: var(--text-3);
}

.input:focus,
.field input:not([type="checkbox"]):not([type="radio"]):focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--action);
    box-shadow: 0 0 0 3px rgba(56, 98, 249, 0.18);
}

.input.is-error,
.field.is-error input,
.field.is-error select,
.field.is-error textarea {
    border-color: var(--bad-mark);
}

.field-hint {
    font-size: 12.5px;
    color: var(--text-2);
}

.field.is-error .field-hint {
    color: var(--bad);
}

/* =============================================
   Status label
   ============================================= */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 9px;
    border-radius: var(--r-status);
    background: var(--mute-bg);
    color: var(--mute);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status--ok { background: var(--ok-bg); color: var(--ok); }
.status--warn { background: var(--warn-bg); color: var(--warn); }
.status--info { background: var(--info-bg); color: var(--info); }
.status--bad { background: var(--bad-bg); color: var(--bad); }

/* =============================================
   Product logo: tibs + badge
   The badge scales with --plogo-h (the height of the logo): 64% high,
   letters at 34%. Variants: outline (default), filled, tint.
   ============================================= */
.plogo {
    --plogo-h: 24px;
    --plogo-c: var(--action);
    --plogo-text: var(--link);
    --plogo-tint: var(--info-bg);
    display: inline-flex;
    align-items: center;
    gap: calc(var(--plogo-h) * 0.3);
    line-height: 1;
    vertical-align: middle;
}

.plogo > img,
.plogo > svg {
    display: block;
    height: var(--plogo-h);
    width: auto;
}

.pbadge {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--plogo-h, 24px) * 0.12);
    box-sizing: border-box;
    height: calc(var(--plogo-h, 24px) * 0.64);
    padding: 0 calc(var(--plogo-h, 24px) * 0.26);
    border: max(1px, calc(var(--plogo-h, 24px) / 26)) solid var(--ink);
    border-radius: calc(var(--plogo-h, 24px) * 0.19);
    color: var(--ink);
    font-family: var(--font);
    font-size: calc(var(--plogo-h, 24px) * 0.34);
    font-weight: 600;
    font-style: normal;
    letter-spacing: 0.02em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.pbadge::before {
    content: "";
    flex: none;
    width: max(5px, calc(var(--plogo-h, 24px) * 0.13));
    height: max(5px, calc(var(--plogo-h, 24px) * 0.13));
    border-radius: 50%;
    background: var(--plogo-c, var(--action));
}

.pbadge--filled {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.pbadge--tint {
    background: var(--plogo-tint, var(--info-bg));
    border-color: transparent;
    color: var(--plogo-text, var(--link));
}

.pbadge--tint::before {
    display: none;
}

.on-ink .pbadge {
    border-color: rgba(255, 255, 255, 0.28);
    color: var(--ink-text);
}

.on-ink .pbadge--filled {
    background: var(--ink-text);
    border-color: var(--ink-text);
    color: var(--ink);
}

.plogo--erp, .pbadge--erp { --plogo-c: var(--p-erp); --plogo-text: var(--p-erp-text); --plogo-tint: var(--p-erp-tint); }
.plogo--chat, .pbadge--chat { --plogo-c: var(--p-chat); --plogo-text: var(--p-chat-text); --plogo-tint: var(--p-chat-tint); }
.plogo--hub, .pbadge--hub { --plogo-c: var(--p-hub); --plogo-text: var(--p-hub-text); --plogo-tint: var(--p-hub-tint); }
.plogo--dna, .pbadge--dna { --plogo-c: var(--p-dna); --plogo-text: var(--p-dna-text); --plogo-tint: var(--p-dna-tint); }
.plogo--web, .pbadge--web { --plogo-c: var(--p-web); --plogo-text: var(--p-web-text); --plogo-tint: var(--p-web-tint); }
.plogo--api, .pbadge--api { --plogo-c: var(--p-api); --plogo-text: var(--p-api-text); --plogo-tint: var(--p-api-tint); }
.plogo--ngo, .pbadge--ngo { --plogo-c: var(--p-ngo); --plogo-text: var(--p-ngo-text); --plogo-tint: var(--p-ngo-tint); }
.plogo--pos, .pbadge--pos { --plogo-c: var(--p-pos); --plogo-text: var(--p-pos-text); --plogo-tint: var(--p-pos-tint); }

/* =============================================
   Motion: nothing moves for people who asked for less
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
