/* ──────────────────────────────────────────────────────────
   CECAL · App-level base styles
   - Fundo wave para tema claro / gradiente profundo para escuro
   - Splash screen com identidade CECAL
   ────────────────────────────────────────────────────────── */

html, body {
    min-height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color-scheme: light dark;
}

/* Fundo padrão (claro) – wave do CECAL */
body {
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(127,206,221,0.35) 0%, rgba(127,206,221,0) 60%),
        radial-gradient(120% 80% at 100% 100%, rgba(84,183,209,0.30) 0%, rgba(84,183,209,0) 60%),
        url('../Fundo.webp') center / cover no-repeat fixed,
        #EAF5F9;
    transition: background 350ms ease;
}

@media (min-width: 768px) {
    body {
        background-attachment: fixed;
    }
}
/* Tema escuro – mesma onda, repaginada em tons profundos de teal/navy */
body:has(.modo-escuro),
body.mud-theme-dark {
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(95,196,222,0.10) 0%, rgba(95,196,222,0) 55%),
        radial-gradient(120% 80% at 100% 100%, rgba(26,106,131,0.20) 0%, rgba(26,106,131,0) 55%),
        url('../Fundo_escuro.webp') center / cover no-repeat fixed,
        #0A1A22;
    transition: background 350ms ease;
}

@media (min-width: 768px) {
    body:has(.modo-escuro),
    body.mud-theme-dark {
        background-attachment: fixed;
    }
}

/* ── Validação Blazor ─────────────────────────────────── */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #2BB673;
}

.invalid {
    outline: 1px solid #E5484D;
}

.validation-message {
    color: #E5484D;
    font-size: 0.75rem;
}

/* ── Erro global Blazor ──────────────────────────────── */
#blazor-error-ui {
    color-scheme: light only;
    background: #FFF7D6;
    bottom: 0;
    box-shadow: 0 -1px 8px rgba(0,0,0,0.18);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    color: #5E4B00;
}

#blazor-error-ui .reload {
    color: #1A6A83;
    font-weight: 600;
    margin: 0 0.5rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.6rem;
}

.blazor-error-boundary {
    background: linear-gradient(135deg, #E5484D 0%, #B32121 100%);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 12px;
}

.blazor-error-boundary::after {
    content: "Ocorreu um erro nesta seção.";
}

/* ── Splash screen ───────────────────────────────────── */
.splash {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.splash-card {
    width: 320px;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 24px;
    box-shadow:
        0 20px 60px rgba(13,74,94,0.25),
        0 4px 16px rgba(13,74,94,0.10);
    overflow: hidden;
    font-family: 'Poppins', Helvetica, Arial, sans-serif;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.8);
}

.splash-header {
    background:
        linear-gradient(150deg, rgba(127,206,221,0.95) 0%, rgba(58,150,180,0.98) 50%, rgba(26,106,131,1) 100%);
    padding: 36px 24px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.splash-header::after {
    content: "";
    position: absolute;
    inset: auto 0 -1px 0;
    height: 28px;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.94));
    pointer-events: none;
}

.splash-logo {
    height: 96px;
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,0.22));
    animation: splash-pulse 2.4s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes splash-pulse {
    0%, 100% { opacity: 1;    transform: scale(1); }
    50%      { opacity: 0.85; transform: scale(0.95); }
}

.splash-body {
    padding: 28px 32px 36px;
}

.splash-title {
    margin: 0 0 6px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1A6A83;
    letter-spacing: 0.08em;
}

.splash-subtitle {
    margin: 0 0 24px;
    font-size: 0.78rem;
    color: rgba(58,150,180,0.7);
    letter-spacing: 0.03em;
}

.splash-ring-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto;
}

.loading-progress {
    position: absolute;
    inset: 0;
    display: block;
    width: 72px;
    height: 72px;
}

.loading-progress circle {
    fill: none;
    stroke: rgba(84,183,209,0.18);
    stroke-width: 0.5rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
    stroke-linecap: round;
}

.loading-progress circle:last-child {
    stroke: #54B7D1;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.12s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #1A6A83;
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "...");
}

code {
    color: #C02D76;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.875em;
}
