/* ============================================
   ATR OS — PRODUCT UI MOCKS
   Mini-telas vivas do sistema (dark + dourado),
   com movimento ambiente e interação no hover.
   Usadas na página Produto (tecnologia.html).
   ============================================ */

:root {
    --ui-green: #22C55E;
    --ui-red: #F2555A;
    --ui-amber: #E8C961;
    --ui-blue: #3B82F6;
    --ui-line: rgba(255, 255, 255, 0.06);
}

/* ===== FRAME (janela do app) ===== */
.ui-mock {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 330px;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(120% 120% at 80% -10%, rgba(212, 175, 55, 0.06) 0%, transparent 45%),
        linear-gradient(160deg, var(--black-elevated) 0%, var(--black-surface) 100%);
    font-family: var(--font-body);
    color: var(--text-primary);
    overflow: hidden;
    user-select: none;
}

.ui-mock__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.015);
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
    flex-shrink: 0;
}

.ui-mock__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 0 var(--gold-glow);
    animation: uim-pulse 2.4s ease-out infinite;
}

.ui-mock__title {
    color: var(--gray);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.ui-mock__title b {
    color: var(--white);
    font-weight: 700;
}

.ui-mock__tag {
    margin-left: auto;
    font-size: 0.66rem;
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: var(--gold-subtle);
    padding: 3px 10px;
    border-radius: 100px;
    font-weight: 600;
}

.ui-mock__body {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

/* ===== PILLS / BADGES ===== */
.uim-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    white-space: nowrap;
}

.uim-pill::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.uim-pill--green {
    color: var(--ui-green);
    background: rgba(34, 197, 94, 0.12);
}

.uim-pill--amber {
    color: var(--ui-amber);
    background: rgba(232, 201, 97, 0.12);
}

.uim-pill--gold {
    color: var(--gold);
    background: var(--gold-subtle);
}

.uim-pill--live::before {
    animation: uim-blink 1.6s steps(1) infinite;
}

.uim-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--gray-light);
    white-space: nowrap;
}

.uim-badge--green {
    color: var(--ui-green);
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.08);
}

.uim-badge--gold {
    color: var(--gold);
    border-color: rgba(212, 175, 55, 0.3);
    background: var(--gold-subtle);
}

/* ===== VERDITO (cockpit) ===== */
.uim-verdict {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.02));
    border: 1px solid rgba(34, 197, 94, 0.22);
}

.uim-verdict__txt {
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--gray-light);
}

.uim-verdict__txt b {
    color: var(--white);
}

/* ===== PACING BAR ===== */
.uim-pace__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.72rem;
    color: var(--gray);
    margin-bottom: 6px;
}

.uim-pace__head b {
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 0.84rem;
}

.uim-pace__track {
    position: relative;
    height: 9px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.uim-pace__fill {
    position: absolute;
    inset: 0;
    width: 78%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    box-shadow: 0 0 12px var(--gold-glow);
    transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.ui-mock:hover .uim-pace__fill {
    width: 84%;
}

.uim-pace__marker {
    position: absolute;
    top: -3px;
    bottom: -3px;
    left: 80%;
    width: 2px;
    background: var(--white);
    opacity: 0.8;
}

.uim-pace__marker::after {
    content: 'esperado';
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.58rem;
    color: var(--gray);
    white-space: nowrap;
}

/* ===== KPI STRIP ===== */
.uim-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.uim-kpi {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--black-card);
    border: 1px solid var(--border);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.uim-kpi:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
}

.uim-kpi__label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-dark);
}

.uim-kpi__value {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
    margin: 2px 0;
}

.uim-kpi__delta {
    font-size: 0.66rem;
    font-weight: 600;
}

.uim-up {
    color: var(--ui-green);
}

.uim-down {
    color: var(--ui-red);
}

/* ===== CHART (svg) ===== */
.uim-chart {
    flex: 1;
    min-height: 92px;
    position: relative;
}

.uim-chart svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.uim-chart__area {
    opacity: 0;
    animation: uim-fade 0.9s ease forwards 0.2s;
}

.uim-chart__line {
    fill: none;
    stroke: var(--gold);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: uim-draw 1.8s ease forwards 0.3s;
}

.uim-chart__meta {
    fill: none;
    stroke: var(--gray-dark);
    stroke-width: 1.4;
    stroke-dasharray: 4 4;
}

.uim-chart__dot {
    fill: var(--gold);
    filter: drop-shadow(0 0 5px var(--gold-glow));
    animation: uim-pulse 2.4s ease-out infinite;
}

.uim-chart__danger {
    fill: rgba(242, 85, 90, 0.1);
}

.uim-chart__danger-line {
    stroke: rgba(242, 85, 90, 0.45);
    stroke-width: 1.2;
    stroke-dasharray: 3 3;
}

.uim-chart__low {
    fill: var(--ui-red);
    filter: drop-shadow(0 0 6px rgba(242, 85, 90, 0.6));
    animation: uim-pulse-red 2s ease-out infinite;
}

.uim-chart__lowlabel {
    fill: var(--ui-red);
    font-size: 7px;
    font-weight: 700;
    font-family: var(--font-body);
}

/* ===== LIST (contratos / iniciativas) ===== */
.uim-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}

.uim-item {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--black-card);
    border: 1px solid var(--border);
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    cursor: default;
}

.uim-item:hover {
    transform: translateX(4px);
    border-color: var(--gold);
    background: var(--black-elevated);
}

.uim-item__row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.uim-item__icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--gold-subtle);
    border: 1px solid rgba(212, 175, 55, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold);
    flex-shrink: 0;
}

.uim-item__title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--white);
    line-height: 1.2;
}

.uim-item__sub {
    font-size: 0.66rem;
    color: var(--gray);
}

.uim-item__right {
    margin-left: auto;
    text-align: right;
    flex-shrink: 0;
}

.uim-item__val {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--white);
}

.uim-item__rate {
    font-size: 0.62rem;
    color: var(--gold);
}

/* amortização */
.uim-amort {
    height: 4px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.06);
    margin-top: 8px;
    overflow: hidden;
}

.uim-amort span {
    display: block;
    height: 100%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
}

/* história (revela no hover) */
.uim-history {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    font-size: 0.66rem;
    color: var(--gray-light);
    line-height: 1.4;
    transition: max-height 0.35s ease, opacity 0.35s ease, margin-top 0.35s ease;
}

.uim-item:hover .uim-history {
    max-height: 60px;
    opacity: 1;
    margin-top: 8px;
}

.uim-history b {
    color: var(--gold);
}

/* iniciativas (plano de voo) */
.uim-init__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.uim-init__num {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--gold);
    color: var(--black);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.uim-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
}

.uim-cta {
    margin-left: auto;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--gold);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.uim-item:hover .uim-cta {
    opacity: 1;
    transform: translateX(0);
}

/* "o que moveu" (cockpit) */
.uim-moved {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.uim-moved__row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--gray-light);
}

.uim-moved__row span:last-child {
    margin-left: auto;
    font-weight: 700;
    font-family: var(--font-heading);
}

.uim-section-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-dark);
    font-weight: 600;
}

/* ===== ANIMAÇÕES ===== */
@keyframes uim-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--gold-glow);
    }

    70% {
        box-shadow: 0 0 0 7px rgba(212, 175, 55, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

@keyframes uim-pulse-red {
    0% {
        r: 3.2;
        opacity: 1;
    }

    50% {
        r: 4.4;
        opacity: 0.75;
    }

    100% {
        r: 3.2;
        opacity: 1;
    }
}

@keyframes uim-blink {

    0%,
    60% {
        opacity: 1;
    }

    61%,
    100% {
        opacity: 0.25;
    }
}

@keyframes uim-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes uim-fade {
    to {
        opacity: 1;
    }
}

/* Respeita preferências de movimento reduzido */
@media (prefers-reduced-motion: reduce) {

    .ui-mock__dot,
    .uim-chart__dot,
    .uim-chart__low,
    .uim-pill--live::before {
        animation: none;
    }

    .uim-chart__line {
        stroke-dashoffset: 0;
        animation: none;
    }

    .uim-chart__area {
        opacity: 1;
        animation: none;
    }
}

/* ============================================
   APP SHELL — demo "tela cheia" do ATR OS
   (vive dentro do .browser-frame na página Produto)
   ============================================ */
.appui {
    display: grid;
    grid-template-columns: 212px 1fr;
    height: 100%;
    background: var(--black);
    font-family: var(--font-body);
    text-align: left;
}

.appui__side {
    background: var(--black-surface);
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.appui__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.appui__brand-logo {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--gold-subtle);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.appui__brand-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.1;
}

.appui__brand-sub {
    font-size: 0.6rem;
    color: var(--gray-dark);
}

.appui__navlabel {
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-dark);
    padding: 12px 8px 4px;
    font-weight: 700;
}

.appui__nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border-radius: 8px;
    font-size: 0.74rem;
    color: var(--gray);
    transition: background 0.2s ease, color 0.2s ease;
}

.appui__nav svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.85;
}

.appui__nav:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--white);
}

.appui__nav--active {
    background: var(--gold-subtle);
    color: var(--gold);
    font-weight: 600;
}

.appui__nav--active svg {
    opacity: 1;
}

.appui__divider {
    height: 1px;
    background: var(--border);
    margin: 8px 6px;
}

.appui__main {
    padding: 18px 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.appui__top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.appui__crumb {
    font-size: 0.66rem;
    color: var(--gray-dark);
    margin-bottom: 1px;
}

.appui__title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
}

.appui__chip {
    margin-left: auto;
    font-size: 0.68rem;
    padding: 5px 12px;
    border-radius: 100px;
    border: 1px solid var(--border);
    color: var(--gray-light);
    background: var(--black-card);
}

.appui__ai {
    font-size: 0.68rem;
    padding: 5px 12px;
    border-radius: 100px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--gold);
    background: var(--gold-subtle);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.appui__grid2 {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 13px;
    flex: 1;
    min-height: 0;
}

.appui__panel {
    background: var(--black-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.appui__panel-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray);
}

@media (max-width: 640px) {
    .appui {
        grid-template-columns: 1fr;
    }

    .appui__side {
        display: none;
    }

    .appui__grid2 {
        grid-template-columns: 1fr;
    }
}
