/* RotoAPI 4.0 — Visual Identity
 * Tokens, components and primitives extracted from the design bundle
 * (RotoAPI Identity.html). Referenced by disp/base.html and login screens.
 */

:root {
    /* Navy — cor principal Rotoline */
    --rotoapi-navy-900: #021b33;
    --rotoapi-navy-800: #03294f;
    --rotoapi-navy-700: #043c72;
    --rotoapi-navy-600: #0a5293;
    --rotoapi-navy-500: #1769b0;
    --rotoapi-navy-400: #3f8aca;
    --rotoapi-navy-300: #79ace0;
    --rotoapi-navy-200: #b1cfec;
    --rotoapi-navy-100: #dce9f6;
    --rotoapi-navy-50:  #eef4fb;

    /* Signal — verde Rotoline, reservado a CTAs e status "online" */
    --rotoapi-signal-700: #4d7608;
    --rotoapi-signal-500: #8cc63f;
    --rotoapi-signal-400: #a8d860;
    --rotoapi-signal-ink: #1a2a05;

    /* Ink — texto e superfícies escuras */
    --rotoapi-ink-900: #021b33;
    --rotoapi-ink-800: #1a2029;
    --rotoapi-ink-500: #4a5260;
    --rotoapi-ink-300: #7b8494;

    /* Paper — superfícies claras */
    --rotoapi-paper-000: #ffffff;
    --rotoapi-paper-050: #f4f6f8;
    --rotoapi-paper-100: #e5e9ee;
    --rotoapi-paper-300: #b7bfca;

    /* Status */
    --rotoapi-alert: #d84a2e;
    --rotoapi-warn:  #e6a627;
    --rotoapi-ok:    #8cc63f;
    --rotoapi-info:  #1769b0;
}

/* ---------- Typography utilities ---------- */

.rotoapi-sans { font-family: 'Geist', 'Inter', system-ui, sans-serif; }
.rotoapi-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

.rotoapi-label {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--rotoapi-navy-200);
}

.rotoapi-slogan {
    font-family: 'Geist', 'Inter', system-ui, sans-serif;
    font-style: italic;
    font-size: 12px;
    letter-spacing: -0.1px;
    color: var(--rotoapi-navy-200);
}

/* ---------- Backgrounds ---------- */

.bg-rotoapi-dark {
    background: radial-gradient(ellipse at center, var(--rotoapi-navy-800) 0%, var(--rotoapi-navy-900) 85%);
}

.bg-rotoapi-surface {
    background: var(--rotoapi-paper-050);
}

/* ---------- Brandmark tile (R/) ---------- */

.rotoapi-brandmark {
    --rotoapi-brand-size: 44px;
    width: var(--rotoapi-brand-size);
    height: var(--rotoapi-brand-size);
    background: var(--rotoapi-navy-700);
    border: 1px solid var(--rotoapi-navy-500);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Geist', system-ui, sans-serif;
    font-weight: 800;
    font-size: calc(var(--rotoapi-brand-size) * 0.5);
    letter-spacing: -1px;
    color: #fff;
    flex-shrink: 0;
}
.rotoapi-brandmark::before,
.rotoapi-brandmark::after {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    border-color: #fff;
    border-style: solid;
}
.rotoapi-brandmark::before {
    top: 3px; left: 3px;
    border-width: 1px 0 0 1px;
}
.rotoapi-brandmark::after {
    bottom: 3px; right: 3px;
    border-width: 0 1px 1px 0;
}
.rotoapi-brandmark > .dot {
    position: absolute;
    top: 5px; right: 5px;
    width: 4px; height: 4px;
    background: var(--rotoapi-signal-500);
    border-radius: 50%;
}

.rotoapi-brandmark.is-sm { --rotoapi-brand-size: 28px; }
.rotoapi-brandmark.is-md { --rotoapi-brand-size: 44px; }
.rotoapi-brandmark.is-lg { --rotoapi-brand-size: 64px; }

/* Brandmark light variant (on paper backgrounds) */
.rotoapi-brandmark.is-light {
    background: var(--rotoapi-paper-000);
    border-color: var(--rotoapi-navy-700);
    color: var(--rotoapi-navy-700);
}
.rotoapi-brandmark.is-light::before,
.rotoapi-brandmark.is-light::after {
    border-color: var(--rotoapi-navy-700);
}

/* ---------- Wordmark (Roto + API + 4.0) ---------- */

.rotoapi-wordmark {
    display: inline-flex;
    align-items: baseline;
    font-family: 'Geist', system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1;
}
.rotoapi-wordmark .wm-roto { color: #fff; font-size: 36px; }
.rotoapi-wordmark .wm-api  { color: var(--rotoapi-navy-400); font-size: 36px; letter-spacing: -1px; }
.rotoapi-wordmark .wm-rule {
    width: 2px; height: 26px;
    background: #fff; opacity: 0.45;
    align-self: center;
    margin-left: 10px;
}
.rotoapi-wordmark .wm-tag {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    letter-spacing: 0.5px;
    align-self: center;
    margin-left: 10px;
}

.rotoapi-wordmark.is-sm .wm-roto,
.rotoapi-wordmark.is-sm .wm-api  { font-size: 22px; }
.rotoapi-wordmark.is-sm .wm-rule { height: 16px; }
.rotoapi-wordmark.is-sm .wm-tag  { font-size: 11px; }

.rotoapi-wordmark.is-lg .wm-roto,
.rotoapi-wordmark.is-lg .wm-api  { font-size: 54px; letter-spacing: -2px; }
.rotoapi-wordmark.is-lg .wm-rule { height: 38px; }
.rotoapi-wordmark.is-lg .wm-tag  { font-size: 18px; }

/* Wordmark light variant (for paper surfaces) */
.rotoapi-wordmark.is-light .wm-roto,
.rotoapi-wordmark.is-light .wm-tag { color: var(--rotoapi-navy-700); }
.rotoapi-wordmark.is-light .wm-api { color: var(--rotoapi-navy-700); }
.rotoapi-wordmark.is-light .wm-rule { background: var(--rotoapi-navy-700); opacity: 0.35; }

/* ---------- Panel card (login / auth) ---------- */

.rotoapi-panel {
    background: rgba(4, 60, 114, 0.92);
    border: 1px solid var(--rotoapi-navy-500);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
    position: relative;
}

.rotoapi-panel-header {
    border-bottom: 1px solid var(--rotoapi-navy-500);
    background: rgba(2, 27, 51, 0.35);
}

.rotoapi-panel-status {
    border-top: 1px solid var(--rotoapi-navy-500);
}

/* ---------- LEDs ---------- */

.rotoapi-led {
    width: 8px; height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 6px currentColor;
    display: inline-block;
}
.rotoapi-led.is-red    { background: var(--rotoapi-alert); color: var(--rotoapi-alert); }
.rotoapi-led.is-orange { background: var(--rotoapi-warn);  color: var(--rotoapi-warn); }
.rotoapi-led.is-green  { background: var(--rotoapi-signal-500); color: var(--rotoapi-signal-500); }
.rotoapi-led.is-blink  { animation: rotoapi-blink 1.6s ease-in-out infinite; }

@keyframes rotoapi-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

/* ---------- Form primitives ---------- */

.rotoapi-input {
    width: 100%;
    padding: 12px 14px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 13px;
    color: var(--rotoapi-navy-200);
    background: var(--rotoapi-navy-900);
    border: 1px solid var(--rotoapi-navy-500);
    border-radius: 0;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.rotoapi-input:focus {
    outline: none;
    border-color: var(--rotoapi-navy-400);
    box-shadow: 0 0 0 2px rgba(63, 138, 202, 0.25);
}
.rotoapi-input::placeholder {
    color: var(--rotoapi-navy-300);
    opacity: 0.6;
}
.rotoapi-input.has-suffix {
    padding-right: 44px;
}

.rotoapi-btn {
    width: 100%;
    background: var(--rotoapi-signal-500);
    color: var(--rotoapi-signal-ink);
    font-family: 'Geist', system-ui, sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 14px 0;
    border: none;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .2s ease, transform .1s ease;
}
.rotoapi-btn:hover  { background: var(--rotoapi-signal-400); }
.rotoapi-btn:active { transform: translateY(1px); }

.rotoapi-btn.is-ghost {
    background: transparent;
    color: var(--rotoapi-navy-200);
    border: 1px solid var(--rotoapi-navy-500);
}
.rotoapi-btn.is-ghost:hover {
    background: rgba(23, 105, 176, 0.18);
}

.rotoapi-btn-toggle {
    color: var(--rotoapi-navy-300);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color .2s ease;
}
.rotoapi-btn-toggle:hover { color: var(--rotoapi-navy-200); }

.rotoapi-link {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--rotoapi-navy-300);
    text-decoration: none;
    transition: color .2s ease;
}
.rotoapi-link:hover { color: var(--rotoapi-navy-200); }

/* ---------- Corner brackets ---------- */

.rotoapi-corner {
    position: absolute;
    width: 18px; height: 18px;
    border-color: #fff;
    border-style: solid;
    opacity: 0.55;
    pointer-events: none;
}
.rotoapi-corner.is-tl { top: -1px;    left: -1px;  border-width: 1.5px 0 0 1.5px; }
.rotoapi-corner.is-tr { top: -1px;    right: -1px; border-width: 1.5px 1.5px 0 0; }
.rotoapi-corner.is-bl { bottom: -1px; left: -1px;  border-width: 0 0 1.5px 1.5px; }
.rotoapi-corner.is-br { bottom: -1px; right: -1px; border-width: 0 1.5px 1.5px 0; }

/* ---------- Nodes background pattern ---------- */

.rotoapi-nodes-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0.5;
    pointer-events: none;
}
.rotoapi-nodes-bg svg { width: 100%; height: 100%; }
.rotoapi-nodes-bg .nodes-line { stroke: var(--rotoapi-navy-300); stroke-width: 0.3; fill: none; opacity: 0.35; }
.rotoapi-nodes-bg .nodes-node { fill: var(--rotoapi-navy-300); opacity: 0.55; }

/* ---------- Divider with technical pattern ---------- */

.rotoapi-divider {
    display: flex;
    align-items: center;
    gap: 12px;
}
.rotoapi-divider .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--rotoapi-navy-500), transparent);
}
.rotoapi-divider .dots {
    display: flex;
    gap: 4px;
}
.rotoapi-divider .dots span {
    width: 4px; height: 4px;
    background: var(--rotoapi-navy-400);
}
