/* ═══════════════════════════════════════════════════════════════════════
   iDevice iOSTool — INDEX PÚBLICO · tema âmbar (identidade idevice-iostool.com)
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    --bg:      #0b0806;
    --bg-elev: #150e08;
    --glass:   rgba(20,12,8,.82);
    --glass-hi:rgba(255,122,0,.07);
    --bdr:     rgba(255,160,80,.14);
    --bdr-hi:  rgba(255,160,80,.28);
    --a-glow:  rgba(255,122,0,.35);
    --a-glow-hi:rgba(255,122,0,.55);
    --t1: #fff3e8;
    --t2: #c4ae9c;
    --t3: #907a69;
    --r-lg: 24px;
    --r-md: 15px;
    --font: 'DM Sans','Segoe UI Variable Display','Segoe UI',ui-sans-serif,system-ui,sans-serif;
    --display: 'Orbitron','DM Sans',ui-sans-serif,sans-serif;
}

/* ── Accent fallbacks when branding does not override them ── */
body.fmi-public:not([style*="--a:"]) {
    --a:  #ff7a00;
    --a2: #ffb000;
}

html { scroll-behavior: smooth; }

/* ── Orbs: âmbar + brasa ─────────────────────────────── */
.orb-1 { background: radial-gradient(circle, rgba(255,122,0,.55) 0%, transparent 65%) !important; }
.orb-2 { background: radial-gradient(circle, rgba(255,61,0,.38) 0%, transparent 65%) !important; }
.orb-3 { background: radial-gradient(circle, rgba(255,176,0,.22) 0%, transparent 65%) !important; }

/* ── Page background ─────────────────────────────────── */
body.fmi-public {
    background:
        radial-gradient(ellipse at 10% -5%,  rgba(255,122,0,.14) 0%, transparent 40%),
        radial-gradient(ellipse at 92% 35%,  rgba(255,61,0,.08) 0%, transparent 36%),
        radial-gradient(ellipse at 50% 110%, rgba(255,176,0,.05) 0%, transparent 30%),
        linear-gradient(155deg, #0b0806 0%, #120c07 48%, #0b0806 100%);
    font-feature-settings: "ss01" 1, "cv02" 1, "cv03" 1;
}

/* Grade âmbar */
body.fmi-public::before {
    content: "";
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,122,0,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,122,0,.045) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 80%);
}

/* ── Topbar ──────────────────────────────────────────── */
.topbar {
    min-height: 68px;
    padding: 12px 16px 12px 14px;
    margin-bottom: clamp(34px, 5vw, 62px);
    border-color: rgba(255,160,80,.16);
    border-radius: 22px;
    background: rgba(20,12,8,.82);
    box-shadow:
        0 18px 46px rgba(0,0,0,.55),
        inset 0 1px rgba(255,160,80,.07),
        0 0 0 1px rgba(255,160,80,.06);
    backdrop-filter: blur(24px) saturate(160%);
}

/* Logo iDevice na topbar */
.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    position: relative;
}

.brand-mark img.brand-logo-img {
    width: 42px; height: 42px; object-fit: contain; border-radius: 12px;
    filter: drop-shadow(0 0 8px rgba(255,122,0,.7)) drop-shadow(0 0 18px rgba(255,122,0,.35));
    animation: brandGlow 3.5s ease-in-out infinite;
}

@keyframes brandGlow {
    0%,100% { filter: drop-shadow(0 0 6px rgba(255,122,0,.6))  drop-shadow(0 0 14px rgba(255,122,0,.3)); }
    50%      { filter: drop-shadow(0 0 12px rgba(255,122,0,.9)) drop-shadow(0 0 26px rgba(255,122,0,.55)) drop-shadow(0 0 40px rgba(255,176,0,.2)); }
}

.brand-mark::after { display: none; }

.brand-name {
    font-family: var(--font);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.2px;
    color: var(--t1);
    display: flex;
    flex-direction: column;
    line-height: 1.06;
}
.brand-name .bn-2 { color: var(--a); }
.brand-sub  { color: rgba(255,176,0,.62); letter-spacing: .3px; font-size: 10px; }

/* ── Chips & lang ────────────────────────────────────── */
.chip {
    min-height: 32px;
    padding: 7px 12px;
    background: rgba(255,122,0,.06);
    border: 1px solid rgba(255,160,80,.16);
    border-radius: 10px;
    color: var(--t2);
    transition: all .2s;
}

.chip:hover { border-color: rgba(255,160,80,.32); background: rgba(255,122,0,.1); color: var(--t1); }

.chip i { color: var(--a, #ff7a00); }

.chip-access-open {
    color: var(--warn, #ffc46b);
    border-color: rgba(255,196,107,.28);
    background: rgba(255,196,107,.08);
}

.chip-status {
    background: rgba(53,240,143,.09);
    border-color: rgba(53,240,143,.22);
    color: #35f08f;
}

.chip-status .dot {
    background: #35f08f;
    box-shadow: 0 0 8px rgba(53,240,143,.8);
}

.ix-lang {
    border-radius: 10px;
    background: rgba(255,122,0,.05);
    border: 1px solid rgba(255,160,80,.13);
}

.ix-lang a.active {
    background: linear-gradient(135deg, #ff7a00, #ffb000);
    color: #1a0d00;
}

.admin-link {
    color: #ff7a00;
    border-color: rgba(255,160,80,.25);
    background: rgba(255,122,0,.08);
}

.admin-link:hover {
    color: #fff;
    border-color: rgba(255,160,80,.5);
    background: rgba(255,122,0,.16);
}

.theme-switch:hover {
    color: var(--a, #ff7a00);
    border-color: rgba(255,160,80,.32);
    background: rgba(255,122,0,.08);
}

/* ── Hero ────────────────────────────────────────────── */
.hero-eyebrow {
    border-radius: 8px;
    background: rgba(255,122,0,.07);
    border: 1px solid rgba(255,160,80,.22);
    color: #ffb000;
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: 1.6px;
}

.hero-eyebrow .dot {
    background: #ff7a00;
    box-shadow: 0 0 10px rgba(255,122,0,.85);
}

.hero-h1 .grad {
    background-image: linear-gradient(105deg, #ffb000 0%, #ff7a00 45%, #ff3d00 75%, #ffb000 100%);
    animation-duration: 8s;
}

.hero-sub { color: var(--t2); }

/* ── Pane (cards) ────────────────────────────────────── */
.pane, .tl-card {
    position: relative;
    border-color: rgba(255,160,80,.14);
    background: rgba(20,12,8,.85);
    box-shadow: 0 32px 74px -28px rgba(0,0,0,.85), inset 0 1px rgba(255,160,80,.07);
    backdrop-filter: blur(24px) saturate(160%);
}

.pane::before, .tl-card::before {
    content: "";
    position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    background: radial-gradient(circle at 14% 0%, rgba(255,122,0,.09), transparent 44%);
}

/* Brilho na borda superior dos cards */
.pane::after {
    content: "";
    position: absolute; top: -1px; left: 15%; right: 15%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,160,80,.45), transparent);
    border-radius: 1px;
}

/* ── Step tags & chips ───────────────────────────────── */
.step-tag {
    border-radius: 8px;
    color: #ffb000;
    border-color: rgba(255,160,80,.28);
    background: rgba(255,122,0,.09);
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: 1.2px;
}

.tl-status.run {
    color: #ff7a00;
    background: rgba(255,122,0,.09);
    border-color: rgba(255,160,80,.28);
}

.tl-status.ok  { color: #35f08f; background: rgba(53,240,143,.09); border-color: rgba(53,240,143,.22); }
.tl-status.err { color: var(--err, #ff5470); }

/* ── Buttons ─────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, #ff7a00 0%, #ffb000 100%);
    color: #1a0d00 !important;
    font-weight: 800;
    box-shadow:
        0 12px 32px -10px rgba(255,122,0,.55),
        inset 0 1px rgba(255,255,255,.28);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff8c1a 0%, #ffc233 100%);
    box-shadow: 0 16px 40px -10px rgba(255,122,0,.7), inset 0 1px rgba(255,255,255,.34);
}

.btn-ghost {
    background: rgba(255,122,0,.06);
    border: 1px solid rgba(255,160,80,.18);
    color: var(--t1);
}

.btn-ghost:hover:not(:disabled) { background: rgba(255,122,0,.12); border-color: rgba(255,160,80,.32); }

/* ── Input ───────────────────────────────────────────── */
.field-input {
    min-height: 56px;
    border-radius: 14px;
    border-color: rgba(255,160,80,.2);
    background: rgba(11,8,6,.6);
    color: var(--t1);
}

.field-input:focus {
    background: rgba(11,8,6,.85);
    box-shadow: 0 0 0 4px rgba(255,122,0,.16);
    border-color: #ff7a00;
}

/* ── Timeline ────────────────────────────────────────── */
.tl-head { padding: 20px 22px; border-color: rgba(255,160,80,.10); }

.tl-row.ok .tl-dot  { box-shadow: 0 0 12px rgba(53,240,143,.6); }
.tl-row.err .tl-dot { box-shadow: 0 0 12px rgba(255,84,112,.6); }
.tl-row.next .tl-dot { border-color: #ff7a00; }

.tl-row.ok .tl-chip  { color: #35f08f; border-color: rgba(53,240,143,.25); background: rgba(53,240,143,.09); }
.tl-row.err .tl-chip { color: #ff5470; border-color: rgba(255,84,112,.22); background: rgba(255,84,112,.08); }

/* ── Log entries ─────────────────────────────────────── */
.log-entry { background: rgba(20,12,8,.8); border-left-color: var(--t3); }
.log-entry.success { border-left-color: #35f08f; }
.log-entry.info    { border-left-color: #ff7a00; }
.log-entry.warn    { border-left-color: #ffc46b; }
.log-entry.error   { border-left-color: #ff5470; }

/* ── Footer ──────────────────────────────────────────── */
.foot { border-top-color: rgba(255,160,80,.10); }

/* ── Gate form ───────────────────────────────────────── */
.gate-wrap { max-width: 600px !important; }

/* dica sob o campo: linha de texto, não um segundo input */
.field-hint { background: transparent; border-color: transparent; padding: 2px 2px 0; }

.gate-badge {
    border-radius: 12px;
    border: 1px solid rgba(255,160,80,.22);
    background: rgba(255,122,0,.07);
}

.gate-badge i { color: #ffb000; }

body.fmi-public .gate-live .spin {
    border-color: rgba(255,160,80,.25);
    border-top-color: #ff7a00;
}

body.fmi-public .gate-modal .box {
    box-shadow:
        0 30px 80px rgba(0,0,0,.75),
        0 0 0 1px rgba(255,160,80,.12),
        0 0 40px rgba(255,122,0,.06);
}

body.fmi-public .gate-modal .code {
    color: #ffb000;
    border-color: rgba(255,160,80,.32);
    background: rgba(255,122,0,.1);
}

/* ── Processing visual ───────────────────────────────── */
.proc-ring {
    background: conic-gradient(from 0deg, transparent 0%, #ff7a00 25%, #ffb000 50%, transparent 65%);
    filter: drop-shadow(0 0 20px rgba(255,122,0,.5));
}

.proc-code {
    color: #ffb000;
    text-shadow: 0 0 20px rgba(255,122,0,.7), 0 0 40px rgba(255,122,0,.4);
}

/* ── Results ─────────────────────────────────────────── */
.result-icon.ok  { box-shadow: 0 0 40px rgba(53,240,143,.3); }
.result-icon.err { box-shadow: 0 0 40px rgba(255,84,112,.25); }

.res-sum-pill.ok  { background: rgba(53,240,143,.09); border-color: rgba(53,240,143,.22); color: #35f08f; }
.res-sum-pill.err { background: rgba(255,84,112,.08); border-color: rgba(255,84,112,.2);  color: #ff5470; }

/* ── Sheet modal ─────────────────────────────────────── */
.sheet {
    background: rgba(16,10,7,.98);
    border-color: rgba(255,160,80,.15);
    box-shadow: 0 -28px 80px rgba(0,0,0,.7), 0 -1px rgba(255,160,80,.12);
}

.modal { background: rgba(0,0,0,.8); }

/* ── Removed items ───────────────────────────────────── */
.rm-item { background: rgba(53,240,143,.08); border-color: rgba(53,240,143,.2); }
.rm-icon { background: #35f08f; color: #06210f; }
.rm-tag  { background: rgba(53,240,143,.12); color: #35f08f; }

/* ── Ambient orbs opacity ────────────────────────────── */
.ambient { opacity: .55; }
.orb { filter: blur(110px); }

/* ── Light theme (creme quente) ──────────────────────── */
html[data-theme="light"] {
    --bg:      #fdf6ef;
    --bg-elev: #ffffff;
    --glass:   rgba(255,252,248,.86);
    --glass-hi:rgba(255,122,0,.06);
    --bdr:     rgba(180,90,20,.14);
    --bdr-hi:  rgba(180,90,20,.26);
    --t1: #2a1509;
    --t2: #7a5236;
    --t3: #a3826a;
    --ok:   #0a8f4a;
    --err:  #c8324a;
    --warn: #a86400;
}

html[data-theme="light"] body.fmi-public {
    background:
        radial-gradient(ellipse at 8% -6%,  rgba(255,122,0,.12), transparent 33%),
        radial-gradient(ellipse at 94% 40%, rgba(255,176,0,.08), transparent 30%),
        linear-gradient(150deg, #fdf6ef 0%, #fbeade 52%, #fdf6ef 100%);
}

html[data-theme="light"] body.fmi-public::before {
    background-image:
        linear-gradient(rgba(180,90,20,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(180,90,20,.05) 1px, transparent 1px);
}

html[data-theme="light"] .topbar {
    border-color: rgba(180,90,20,.14);
    background: rgba(255,255,255,.9);
    box-shadow: 0 18px 48px -34px rgba(80,35,5,.28), inset 0 1px rgba(255,122,0,.1);
}

html[data-theme="light"] .pane,
html[data-theme="light"] .tl-card {
    border-color: rgba(180,90,20,.14);
    background: rgba(255,255,255,.92);
    box-shadow: 0 32px 70px -42px rgba(80,35,5,.3), inset 0 1px rgba(255,122,0,.1);
}

html[data-theme="light"] .pane::after { background: linear-gradient(90deg, transparent, rgba(255,122,0,.28), transparent); }

html[data-theme="light"] .ambient { opacity: .18; }
html[data-theme="light"] .btn-primary { color: #fff !important; }
html[data-theme="light"] .brand-sub { color: rgba(180,90,20,.7); }

@media(min-width: 980px) {
    .main { grid-template-columns: minmax(0, 1.38fr) minmax(330px, .82fr); }
    .col-t { top: 22px; }
    body.is-gated .topbar { width: min(100%, 880px); margin-inline: auto; }
}

@media(max-width: 760px) {
    .topbar { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 12px; margin-bottom: 30px; border-radius: 18px; height: auto; min-height: 0; align-content: center; }
    .top-meta { width: 100%; margin-left: 0; justify-content: flex-start; flex-wrap: nowrap; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: 2px;
                mask-image: linear-gradient(90deg, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); }
    .top-meta::-webkit-scrollbar { display: none; }
    .chip, .ix-lang { flex: 0 0 auto; }
    .chip-access-open, .theme-switch, .admin-link { display: inline-flex !important; }
    .brand-sub { display: none; }
    .hero { padding-inline: 2px; }
    .stage { min-height: 0; }
    .pane, .tl-card { border-radius: 18px; }
}

@media(prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .brand-mark img, .orb { animation: none !important; }
}
