/* ══════════════════════════════════════════════════════════════
   errors.css — CSS partilhado para páginas de erro da Rádio Maiata
   Colocar em: css/errors.css
   ══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:      #1877F2;
    --primary-glow: rgba(24,119,242,.35);
    --border:       #1e3a6e;
    --text:         #e8f0fe;
    --muted:        #93aed6;
}

body {
    font-family: 'Outfit', sans-serif;
    background: url("images/bg1.webp") center/cover no-repeat fixed;
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    overflow: hidden;
}

/* Overlay */
.bg-overlay {
    position: fixed; inset: 0;
    background: rgba(6,12,24,.78);
    pointer-events: none; z-index: 0;
}

/* Grid animado */
body::before {
    content: ''; position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(24,119,242,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(24,119,242,.06) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridMove 20s linear infinite;
    pointer-events: none; z-index: 1;
}
@keyframes gridMove { to { background-position: 40px 40px; } }

/* Orbs */
.orb {
    position: fixed; border-radius: 50%;
    filter: blur(80px); pointer-events: none; z-index: 2;
    animation: orbFloat 9s ease-in-out infinite;
}
.orb-1 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(24,119,242,.18) 0%, transparent 70%);
    top: 10%; left: 15%;
}
.orb-2 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(120,60,220,.12) 0%, transparent 70%);
    bottom: 10%; right: 15%;
    animation-duration: 11s;
    animation-delay: -4s;
}
@keyframes orbFloat {
    0%, 100% { transform: translate(0,0); }
    33%  { transform: translate(30px,-20px); }
    66%  { transform: translate(-20px,15px); }
}

/* Partículas */
#particles { position: fixed; inset: 0; pointer-events: none; z-index: 2; }

/* Logo — inline, colado acima do card */
.logo {
    position: relative; z-index: 5;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    animation: fadeDown .6s ease both;
}
.logo img {
    height: 52px; opacity: .88;
    filter: drop-shadow(0 0 12px rgba(24,119,242,.4));
}
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Card */
.card {
    position: relative; z-index: 5;
    background: linear-gradient(145deg, rgba(18,32,64,.95), rgba(10,22,40,.98));
    border: 1px solid rgba(30,58,110,.8);
    border-radius: 24px;
    padding: 52px 44px;
    max-width: 480px; width: 100%;
    text-align: center;
    box-shadow:
        0 8px 48px rgba(0,0,0,.7),
        0 0 0 1px rgba(24,119,242,.08),
        inset 0 1px 0 rgba(255,255,255,.05);
    animation: cardIn .7s cubic-bezier(.22,1,.36,1) .1s both;
    backdrop-filter: blur(12px);
}
.card::before {
    content: ''; position: absolute;
    top: 0; left: 20%; right: 20%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px) scale(.97); }
    to   { opacity: 1; transform: scale(1); }
}

/* Ícone com efeito glitch */
.icon-wrap {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 72px; height: 72px; margin-bottom: 28px;
    animation: iconPop .5s cubic-bezier(.22,1,.36,1) .3s both;
    overflow: hidden;
}
@keyframes iconPop {
    from { opacity: 0; transform: scale(.6); }
    to   { opacity: 1; transform: scale(1); }
}
.icon {
    font-size: 4rem;
    position: relative; z-index: 2;
    animation: iconGlitch 5s ease-in-out infinite;
}
@keyframes iconGlitch {
    0%, 88%, 100% { transform: translate(0,0);      filter: none; }
    89%  { transform: translate(-3px, 1px); filter: drop-shadow(3px 0 0 #00ffff) drop-shadow(-3px 0 0 #ff006e); }
    90%  { transform: translate(3px, -2px); filter: drop-shadow(-3px 0 0 #00ffff) drop-shadow(3px 0 0 #ff006e); }
    91%  { transform: translate(-2px, 2px); filter: drop-shadow(2px 0 0 #00ffff) drop-shadow(-2px 0 0 #ff006e); }
    92%  { transform: translate(0,0);      filter: none; }
    93%  { transform: translate(2px, -1px); filter: drop-shadow(-2px 0 0 #00ffff) drop-shadow(2px 0 0 #ff006e); }
    94%  { transform: translate(0,0);      filter: none; }
}

/* Código de erro */
.code {
    font-size: 5.5rem; font-weight: 700;
    color: var(--primary); line-height: 1;
    margin-bottom: 20px; letter-spacing: -2px;
    text-shadow: 0 0 60px var(--primary-glow), 0 0 20px rgba(24,119,242,.5);
    animation: codeIn .6s ease .4s both;
    position: relative; display: inline-block;
}
@keyframes codeIn {
    from { opacity: 0; transform: scale(1.15); filter: blur(8px); }
    to   { opacity: 1; transform: scale(1); filter: blur(0); }
}
.code::before, .code::after {
    content: attr(data-text);
    position: absolute; inset: 0;
    font-size: inherit; font-weight: inherit;
    animation: glitch 5s infinite;
}
.code::before { color: #00ffff; clip-path: polygon(0 20%,100% 20%,100% 40%,0 40%); opacity: .7; }
.code::after  { color: #ff006e; clip-path: polygon(0 60%,100% 60%,100% 80%,0 80%); animation-delay: .15s; opacity: .7; }
@keyframes glitch {
    0%, 92%, 100% { transform: translate(0); opacity: 0; }
    93% { transform: translate(-3px,1px);  opacity: .7; }
    94% { transform: translate(3px,-1px);  opacity: .7; }
    95% { transform: translate(-2px,2px);  opacity: .7; }
    96% { transform: translate(0);         opacity: 0; }
}

/* Texto */
.title {
    font-size: 1.45rem; font-weight: 600;
    margin-bottom: 12px;
    animation: fadeUp .5s ease .5s both;
}
.msg {
    font-size: .93rem; color: var(--muted);
    line-height: 1.65; margin-bottom: 36px;
    animation: fadeUp .5s ease .6s both;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Botão */
.btn {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 13px 30px;
    background: linear-gradient(135deg, #1877F2, #0f5ecb);
    color: #fff; border-radius: 12px;
    text-decoration: none; font-weight: 600; font-size: .95rem;
    transition: all .2s; position: relative; overflow: hidden;
    animation: fadeUp .5s ease .7s both;
    box-shadow: 0 4px 20px rgba(24,119,242,.3);
    border: none; cursor: pointer; font-family: inherit;
}
.btn::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.15), transparent);
    opacity: 0; transition: opacity .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(24,119,242,.5); }
.btn:hover::before { opacity: 1; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* Status dot (offline.html) */
.status {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-size: .82rem; color: var(--muted);
    margin-bottom: 28px; padding: 12px 18px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(30,58,110,.6);
    border-radius: 12px;
    animation: fadeUp .5s ease .6s both;
}
.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #f72585; flex-shrink: 0;
    box-shadow: 0 0 8px #f72585;
    animation: dotBlink 1.5s ease-in-out infinite;
}
.status-dot.online { background: #06d6a0; box-shadow: 0 0 8px #06d6a0; animation: none; }
@keyframes dotBlink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.retry-msg {
    margin-top: 14px; font-size: .78rem;
    color: var(--muted);
    animation: fadeUp .5s ease .8s both;
}

/* Antena (offline.html) */
.antenna-wrap {
    position: relative; display: inline-flex;
    align-items: center; justify-content: center;
    width: 80px; height: 80px; margin-bottom: 24px;
    animation: cardIn .5s ease .3s both;
}
.antenna-emoji {
    font-size: 2.6rem; position: relative; z-index: 2;
    animation: antennaPulse 2.5s ease-in-out infinite;
}
@keyframes antennaPulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50%       { transform: scale(1.08); filter: brightness(1.3); }
}
.ring {
    position: absolute; border-radius: 50%;
    border: 1px solid rgba(24,119,242,.4);
    animation: ringExpand 2.5s ease-out infinite;
}
.ring-1 { width: 60px;  height: 60px;  animation-delay: 0s; }
.ring-2 { width: 80px;  height: 80px;  animation-delay: .6s; }
.ring-3 { width: 100px; height: 100px; animation-delay: 1.2s; }
@keyframes ringExpand {
    0%   { transform: scale(.6); opacity: .8; }
    100% { transform: scale(1.2); opacity: 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsivo */
@media (max-width: 480px) {
    .card { padding: 40px 24px; }
    .code { font-size: 4rem; }
    .logo img { height: 44px; }
}