/* =========================================================
   FÊNIX ONLINE — Design System (Apple Liquid Glass)
   Paleta: renascimento em brasa saindo do escuro.
   ========================================================= */

:root {
    /* Fundo */
    --bg-color: #08070a;
    --bg-color-alt: #0d0b10;

    /* Blobs ambiente — brasas do Fênix */
    --blob-1: #ff5f3c;   /* ember coral  */
    --blob-2: #8b5cf6;   /* violet rebirth */
    --blob-3: #ffcf5c;   /* gold spark   */
    --blob-opacity: 0.55;

    /* Liquid Glass — superfícies */
    --glass-bg: rgba(30, 26, 32, 0.45);
    --glass-bg-strong: rgba(30, 26, 32, 0.65);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-shadow: rgba(0, 0, 0, 0.75);
    --glass-highlight: rgba(255, 255, 255, 0.22);
    --glass-caustic: rgba(255, 255, 255, 0.05);
    --reflection-start: rgba(255, 255, 255, 0.14);
    --reflection-end: rgba(255, 255, 255, 0);
    --glare-color: rgba(255, 165, 120, 0.22);

    /* Pill / controles */
    --pill-bg: rgba(60, 50, 55, 0.75);
    --pill-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.18);
    --icon-color: rgba(255, 255, 255, 0.5);
    --icon-active: #ffffff;
    --divider: rgba(255, 255, 255, 0.14);

    /* Texto */
    --text-primary: rgba(255, 255, 255, 0.96);
    --text-secondary: rgba(255, 255, 255, 0.56);
    --text-tertiary: rgba(255, 255, 255, 0.34);

    /* Acento de marca */
    --ember: #ff5f3c;
    --ember-soft: #ffb37a;
    --violet: #8b5cf6;

    --radius-lg: 28px;
    --radius-pill: 99px;
}

[data-theme="light"] {
    --bg-color: #f2efe9;
    --bg-color-alt: #ece7de;
    --blob-opacity: 0.5;

    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-bg-strong: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: rgba(30, 20, 15, 0.16);
    --glass-highlight: rgba(255, 255, 255, 0.85);
    --glass-caustic: rgba(255, 255, 255, 0.4);
    --reflection-start: rgba(255, 255, 255, 0.7);
    --reflection-end: rgba(255, 255, 255, 0);
    --glare-color: rgba(255, 255, 255, 0.6);

    --pill-bg: rgba(255, 255, 255, 0.75);
    --pill-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.8);
    --icon-color: rgba(20, 15, 15, 0.5);
    --icon-active: rgba(20, 15, 15, 0.95);
    --divider: rgba(20, 15, 15, 0.12);

    --text-primary: rgba(20, 15, 15, 0.94);
    --text-secondary: rgba(20, 15, 15, 0.56);
    --text-tertiary: rgba(20, 15, 15, 0.36);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    background: var(--bg-color);
    overscroll-behavior: none; /* impede o "bounce" do iOS revelar o fundo preto abaixo do mesh */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background 0.6s ease, color 0.4s ease;
}

/* Fundo com mesh de brasas (motion blur ambiente) */
.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg-color);
    overflow: hidden;
    transition: background 0.8s ease;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: var(--blob-opacity);
    animation: float 22s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
    will-change: transform;
    transition: background 0.8s ease, opacity 0.8s ease;
}

.blob-1 { width: 60vw; height: 60vw; top: -15%; left: -20%; background: var(--blob-1); }
.blob-2 { width: 55vw; height: 55vw; bottom: -20%; right: -15%; background: var(--blob-2); animation-delay: -6s; }
.blob-3 { width: 40vw; height: 40vw; top: 35%; left: 30%; background: var(--blob-3); animation-delay: -12s; }

@keyframes float {
    0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
    33%  { transform: translate(5%, 8%) scale(1.06) rotate(6deg); }
    66%  { transform: translate(-6%, 4%) scale(0.94) rotate(-6deg); }
    100% { transform: translate(0, -8%) scale(1.08) rotate(0deg); }
}

/* Camada de motion blur entre trocas de tela */
.transition-veil {
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    opacity: 0;
    transition: backdrop-filter 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.45s ease;
}
.transition-veil.active {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 1;
}

/* =========================================================
   Cartão de vidro genérico
   ========================================================= */
.glass-card {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: var(--radius-lg);
    box-shadow:
        0 30px 60px -15px var(--glass-shadow),
        0 8px 24px -8px var(--glass-shadow),
        inset 0 1.5px 2px -1px var(--glass-highlight),
        inset 0 -2px 4px -1px var(--glass-caustic),
        inset 0 0 0 1px var(--glass-border);
    transition: background 0.5s ease, box-shadow 0.5s ease;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 1px; left: 1px; right: 1px;
    height: 40%;
    border-radius: var(--radius-lg) var(--radius-lg) 40px 40px / var(--radius-lg) var(--radius-lg) 20px 20px;
    background: linear-gradient(180deg, var(--reflection-start) 0%, var(--reflection-end) 100%);
    pointer-events: none;
}

/* Inputs de vidro */
.glass-input {
    width: 100%;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease;
}
[data-theme="light"] .glass-input { background: rgba(255, 255, 255, 0.35); }
.glass-input::placeholder { color: var(--text-tertiary); }
.glass-input:focus { border-color: rgba(255, 137, 91, 0.6); background: rgba(255, 137, 91, 0.08); }

/* Botão primário — brasa */
.btn-ember {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 18px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #180a06;
    background: linear-gradient(135deg, var(--ember-soft), var(--ember));
    box-shadow: 0 10px 30px -8px rgba(255, 95, 60, 0.55);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.3s ease, opacity 0.2s ease;
}
.btn-ember:active { transform: scale(0.97); }
.btn-ember:disabled { opacity: 0.55; cursor: default; }

/* Botão texto/ghost */
.btn-ghost {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.2s ease;
}
.btn-ghost:active { transform: scale(0.97); }

/* Eyebrow / label rastreada */
.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ember-soft);
}

.error-text {
    font-size: 13px;
    color: #ff8a80;
    min-height: 18px;
}

/* Marca — glifo do Fênix */
.phoenix-mark {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 0 18px rgba(255, 111, 63, 0.55));
    animation: pulse-ember 3.2s ease-in-out infinite;
}
@keyframes pulse-ember {
    0%, 100% { filter: drop-shadow(0 0 14px rgba(255, 111, 63, 0.4)); }
    50%      { filter: drop-shadow(0 0 26px rgba(255, 149, 90, 0.75)); }
}

@media (prefers-reduced-motion: reduce) {
    .blob, .phoenix-mark { animation: none !important; }
    * { transition-duration: 0.01ms !important; }
}
