/* Variaveis de cor - identidade FibraFacil */
:root {
    --fibra-blue:       #0D2D6D;
    --fibra-blue-mid:   #1A4BAB;
    --fibra-blue-light: #E8F0FF;
    --fibra-orange:     #FF6A00;
    --fibra-orange-drk: #D95800;
    --fibra-gray:       #F2F4F7;
    --fibra-gray-text:  #64748B;

    /* Tokens semanticos - modo claro */
    --bg-page:    #F2F4F7;
    --bg-card:    #FFFFFF;
    --bg-json:    #F8FAFC;
    --text-base:  #1E293B;
    --text-muted: #64748B;
    --border:     #E2E8F0;
    --shadow-card: 0 1px 3px rgba(13,45,109,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-hover: 0 4px 14px rgba(13,45,109,0.13);
}

/* Tokens semanticos - modo escuro */
.dark {
    --bg-page:    #060C18;
    --bg-card:    #0A1628;
    --bg-json:    #040A12;
    --text-base:  #F1F5F9;
    --text-muted: #94A3B8;
    --border:     #152E58;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.45);
    --shadow-hover: 0 4px 14px rgba(0,0,0,0.35);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    background-color: var(--bg-page);
    color: var(--text-base);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

::selection { background: rgba(255,106,0,0.2); }

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover { box-shadow: var(--shadow-hover); }

/* Botoes */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--fibra-blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.1s ease;
    text-decoration: none;
}

.btn-primary:hover  { background: var(--fibra-blue-mid); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--fibra-blue);
    border: 1.5px solid var(--fibra-blue);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-secondary:hover { background: var(--fibra-blue-light); }

.dark .btn-secondary {
    color: #93C5FD;
    border-color: #1E4A8A;
}

.dark .btn-secondary:hover { background: rgba(30,74,138,0.25); }

/* Badges de status */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-online  { background: rgba(22,163,74,0.12); color: #15803D; border-color: rgba(22,163,74,0.22); }
.badge-online .badge-dot { background: #22C55E; }

.dark .badge-online { background: rgba(22,163,74,0.18); color: #4ADE80; }

.badge-loading { background: rgba(13,45,109,0.08); color: var(--fibra-blue); border-color: rgba(13,45,109,0.16); }
.badge-loading .badge-dot { background: var(--fibra-blue); animation: blink 1.4s ease-in-out infinite; }

.dark .badge-loading { background: rgba(30,74,138,0.22); color: #93C5FD; border-color: rgba(30,74,138,0.4); }
.dark .badge-loading .badge-dot { background: #93C5FD; }

.badge-error { background: rgba(220,38,38,0.1); color: #DC2626; border-color: rgba(220,38,38,0.2); }
.badge-error .badge-dot { background: #EF4444; }

.badge-degraded { background: rgba(245,158,11,0.1); color: #B45309; border-color: rgba(245,158,11,0.2); }
.badge-degraded .badge-dot { background: #F59E0B; }

.dark .badge-degraded { color: #FCD34D; }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.25; }
}

/* Faixa de fibra optica */
.fibra-stripe {
    height: 3px;
    background: linear-gradient(90deg, var(--fibra-blue) 0%, var(--fibra-blue-mid) 45%, var(--fibra-orange) 100%);
    flex-shrink: 0;
}

/* Onda de transicao entre secoes */
.fibra-wave {
    overflow: hidden;
    line-height: 0;
    pointer-events: none;
}

.fibra-wave svg { display: block; width: 100%; }

/* Elemento grafico de localizacao (CSS puro) */
.geo-art {
    position: relative;
    width: 240px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.geo-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.geo-ring-xl { width: 224px; height: 224px; border: 1px solid rgba(13,45,109,0.10); }
.geo-ring-lg { width: 152px; height: 152px; border: 1.5px dashed rgba(13,45,109,0.14); }
.geo-ring-sm { width: 80px;  height: 80px;  background: rgba(13,45,109,0.05); border: 1px solid rgba(13,45,109,0.12); }

.dark .geo-ring-xl { border-color: rgba(30,74,138,0.22); }
.dark .geo-ring-lg { border-color: rgba(30,74,138,0.28); }
.dark .geo-ring-sm { background: rgba(30,74,138,0.14); border-color: rgba(30,74,138,0.25); }

.geo-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid var(--fibra-orange);
    opacity: 0;
    animation: geoPulse 2.6s ease-out infinite;
    pointer-events: none;
}

@keyframes geoPulse {
    0%   { width: 36px; height: 36px; opacity: 0.65; }
    100% { width: 96px; height: 96px; opacity: 0; }
}

.geo-pin-body {
    position: relative;
    z-index: 5;
    width: 38px;
    height: 38px;
    background: var(--fibra-orange);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 4px 16px rgba(255,106,0,0.38);
}

.geo-pin-body::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 15px;
    height: 15px;
    background: #fff;
    border-radius: 50%;
}

/* IP em destaque */
.ip-display {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 700;
    font-size: clamp(1.75rem, 5vw, 3.25rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    word-break: break-all;
    color: var(--fibra-blue);
    user-select: all;
    cursor: text;
}

.dark .ip-display { color: #F1F5F9; }

/* Cards tecnicos */
.card-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--fibra-blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 0.75rem;
    color: var(--fibra-blue);
}

.dark .card-icon-wrap { background: rgba(30,74,138,0.2); color: #93C5FD; }

.card-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--fibra-gray-text);
    margin-bottom: 0.3rem;
}

.dark .card-label { color: #64748B; }

.card-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-base);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-sub {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Bloco JSON */
.json-outer {
    background: var(--bg-json);
    overflow-x: auto;
}

.json-pre {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--text-muted);
    white-space: pre;
    padding: 1rem 1.25rem;
    margin: 0;
}

/* Syntax highlighting JSON */
.jk { color: #0369A1; }
.jv { color: #15803D; }
.jn { color: #B45309; }
.jb { color: #7C3AED; }
.jx { color: #9CA3AF; font-style: italic; }

.dark .jk { color: #7DD3FC; }
.dark .jv { color: #86EFAC; }
.dark .jn { color: #FBB97A; }
.dark .jb { color: #C4B5FD; }
.dark .jx { color: #4B5563; }

/* Historico */
.history-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s ease;
}

.history-entry:last-child { border-bottom: none; }
.history-entry:hover { background: var(--bg-page); }

.history-ip {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--fibra-blue);
}

.dark .history-ip { color: #93C5FD; }

/* Link ver no mapa */
.map-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fibra-blue);
    text-decoration: none;
    transition: color 0.15s ease;
}

.map-link:hover { color: var(--fibra-orange); }

.dark .map-link { color: #93C5FD; }
.dark .map-link:hover { color: var(--fibra-orange); }

/* Toggle dark mode (no header) */
.dark-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.dark-toggle:hover { background: rgba(255,255,255,0.22); }

/* Scrollbar fina para JSON */
.json-outer::-webkit-scrollbar { height: 4px; }
.json-outer::-webkit-scrollbar-track { background: transparent; }
.json-outer::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Logo no cabecalho — altura calibrada para igualar o bloco de texto de duas linhas removido */
.header-logo {
    height: 32px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

/* Logo no rodape */
.footer-logo {
    height: 34px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

/* CTA "Crie sua conta" no rodape */
.footer-cta {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.375rem;
    background: var(--fibra-orange);
    color: #fff;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.1s ease;
    border: none;
    cursor: pointer;
}

.footer-cta:hover  { background: var(--fibra-orange-drk); }
.footer-cta:active { transform: scale(0.98); }

/* Cabecalho do card JSON clicavel */
.json-card-header {
    cursor: pointer;
    user-select: none;
    transition: background 0.12s ease;
}

.json-card-header:hover { background: var(--bg-page); }

/* Texto de loading placeholder */
.ip-placeholder {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 700;
    font-size: clamp(1.75rem, 5vw, 3.25rem);
    color: #CBD5E1;
    letter-spacing: -0.02em;
    animation: pulse 1.6s ease-in-out infinite;
}

.dark .ip-placeholder { color: #1E3A6E; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}
