/* ================================================================
   Visual compartilhado (hero, login-card, splash-loader, notfound)
   Extraído do <style> embutido no Home.razor pra ficar disponível
   em qualquer página do projeto — Home.razor continua com o
   próprio <style> intocado, essas classes só ficam duplicadas
   (mesmo conteúdo), sem risco pro agendamento que já funciona.
   ================================================================ */


/* ===== HERO — cachorro esquerda / gato direita ===== */
.hero-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

    /* Metade esquerda — cachorro */
    .hero-bg::before {
        content: '';
        background-image: url('https://images.unsplash.com/photo-1587300003388-59208cc962cb?w=960&q=85&auto=format&fit=crop&crop=right');
        background-size: cover;
        background-position: right center;
    }

    /* Metade direita — gato */
    .hero-bg::after {
        content: '';
        background-image: url('https://images.unsplash.com/photo-1514888286974-6c03e2ca1dba?w=960&q=85&auto=format&fit=crop&crop=left');
        background-size: cover;
        background-position: left center;
    }

/* Em mobile volta para 1 coluna com gato+cachorro juntos */
@media (max-width: 600px) {
    .hero-bg {
        grid-template-columns: 1fr;
    }

        .hero-bg::after {
            display: none;
        }

        .hero-bg::before {
            background-image: url('https://images.unsplash.com/photo-1450778869180-41d0601e046e?w=800&q=85&auto=format&fit=crop');
            background-position: center center;
        }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient( 135deg, rgba(13, 71, 161, 0.82) 0%, rgba(21, 101, 192, 0.70) 40%, rgba(100, 60, 180, 0.65) 100% );
}

.hero-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

/* ===== CARD DE LOGIN ===== */
.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.35);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(32px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== CABEÇALHO DINÂMICO DO CLIENTE ===== */
.client-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.html-container {
    width: 100%;
    max-width: 100%;
    overflow: auto;
    box-sizing: border-box;
    /* Escala o HTML para caber na largura do card */
    transform-origin: top left;
}

    .html-container img,
    .html-container table,
    .html-container iframe {
        max-width: 100% !important;
        height: auto !important;
    }

/* ===== ÁREA DO FORMULÁRIO ===== */
.login-form-area {
    padding: 28px 28px 20px;
}

@media (max-width: 480px) {
    .login-form-area {
        padding: 20px 16px 16px;
    }
}

/* ===== LOGO LINK ===== */
.logo-link:hover img {
    opacity: 1 !important;
}

/* ===== SPLASH ===== */
.splash-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
}

.splash-bg {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.splash-bg-dog {
    background-image: url('https://images.unsplash.com/photo-1587300003388-59208cc962cb?w=960&q=85&auto=format&fit=crop&crop=right');
    background-size: cover;
    background-position: right center;
}

.splash-bg-cat {
    background-image: url('https://images.unsplash.com/photo-1514888286974-6c03e2ca1dba?w=960&q=85&auto=format&fit=crop&crop=left');
    background-size: cover;
    background-position: left center;
}

.splash-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13,71,161,0.80) 0%, rgba(21,101,192,0.68) 40%, rgba(80,50,170,0.72) 100%);
}

.bg-paw {
    position: absolute;
    font-size: 48px;
    opacity: 0.07;
    animation: bgFloat 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes bgFloat {
    0%, 100% {
        transform: translateY(0) rotate(-10deg);
    }

    50% {
        transform: translateY(-18px) rotate(8deg);
    }
}

.splash-card {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

    .splash-card > div, .splash-card > img, .splash-card > span {
        position: relative;
        z-index: 1;
    }

.splash-logo-card {
    width: 200px;
    filter: brightness(0) invert(1);
    animation: splashIn 0.8s ease-out 0.1s both;
}

.splash-text-card {
    color: rgba(255,255,255,0.92);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    animation: splashIn 0.8s ease-out 0.4s both;
}

.paws-container {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    position: relative;
    z-index: 1;
}

.paw {
    font-size: 22px;
    opacity: 0;
    transform: translateY(8px) scale(0.7);
    animation: pawStep 1.8s ease-in-out infinite;
}

    .paw:nth-child(1) {
        animation-delay: 0.0s;
    }

    .paw:nth-child(2) {
        animation-delay: 0.2s;
    }

    .paw:nth-child(3) {
        animation-delay: 0.4s;
    }

    .paw:nth-child(4) {
        animation-delay: 0.6s;
    }

    .paw:nth-child(5) {
        animation-delay: 0.8s;
    }

@keyframes pawStep {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(0.7);
    }

    20% {
        opacity: 1;
        transform: translateY(0) scale(1.1);
    }

    40% {
        opacity: 0.6;
        transform: translateY(2px) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(8px) scale(0.7);
    }
}

.splash-bar-track {
    width: 220px;
    height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    animation: splashIn 0.5s ease-out 0.5s both;
}

.splash-bar-fill {
    height: 100%;
    background: rgba(255,255,255,0.85);
    border-radius: 8px;
    animation: barIndeterminate 1.6s ease-in-out infinite;
}

@keyframes barIndeterminate {
    0% {
        width: 0%;
        margin-left: 0%;
    }

    50% {
        width: 60%;
        margin-left: 20%;
    }

    100% {
        width: 0%;
        margin-left: 100%;
    }
}

@keyframes splashIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 600px) {
    .splash-bg {
        grid-template-columns: 1fr;
    }

    .splash-bg-cat {
        display: none;
    }

    .splash-bg-dog {
        background-image: url('https://images.unsplash.com/photo-1450778869180-41d0601e046e?w=800&q=85&auto=format&fit=crop');
        background-position: center;
    }

    .splash-logo-card {
        width: 160px;
    }
}

/* ===== NOT FOUND ===== */
.notfound-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #0d47a1;
    color: white;
    text-align: center;
    padding: 0 32px;
}

.notfound-logo {
    display: block;
    width: 80px;
    margin: 0 auto 16px;
    filter: brightness(0) invert(1);
}

.notfound-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.notfound-subtitle {
    opacity: 0.9;
}

@media (max-width: 600px) {
    .notfound-logo {
        width: 70px;
    }
}

/* ===== CONTEÚDO HTML CLÍNICO (timeline do portal) =====
       Os campos Anamnese / Diagnóstico / Tratamentos etc. vêm do banco
       com tags HTML (`<p>`, `<br>`, `<strong>`...). Esta regra normaliza
       o espaçamento pra leitura ficar limpa (sem "tudo grudado"). */
.html-bloco {
    line-height: 1.55;
    color: #222;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

    .html-bloco p {
        margin: 0 0 8px 0;
    }

        .html-bloco p:last-child {
            margin-bottom: 0;
        }

    .html-bloco br {
        line-height: 1.8;
    }

    .html-bloco strong,
    .html-bloco b {
        font-weight: 600;
        color: #111;
    }

    .html-bloco ul,
    .html-bloco ol {
        margin: 4px 0 8px 0;
        padding-left: 22px;
    }

    .html-bloco li {
        margin-bottom: 2px;
    }

    .html-bloco h1,
    .html-bloco h2,
    .html-bloco h3 {
        margin: 8px 0 4px 0;
        font-size: 1rem;
        font-weight: 600;
    }

    .html-bloco a {
        color: #1976D2;
        text-decoration: underline;
    }

    .html-bloco img {
        max-width: 100%;
        height: auto;
        border-radius: 6px;
        margin: 4px 0;
    }

    .html-bloco table {
        width: 100%;
        border-collapse: collapse;
        margin: 4px 0;
    }

        .html-bloco table td,
        .html-bloco table th {
            padding: 4px 6px;
            border-bottom: 1px solid #EEE;
        }

/* ============================================================
   PORTAL DO CLIENTE — visual novo (alinhado ao mock de referência)
   Escopado em .portal-shell pra não vazar pro Home/Agendamento online.
   ============================================================ */
.portal-shell {
    --p-brand: #2b50e2;
    --p-brand-dark: #1f3fb8;
    --p-brand-soft: #e4e9fc;
    --p-brand-tint: #f3f5fe;
    --p-ink: #151b2b;
    --p-muted: #67718a;
    --p-line: #e6e9f0;
    --p-page: #eef1f7;
    min-height: 100vh;
    background: var(--p-page);
    padding: 24px 4vw 64px;
}

    .portal-shell .portal-inner {
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
    }

    /* Cards: qualquer MudPaper dentro do portal vira o card branco arredondado do mock */
    .portal-shell .mud-paper {
        border-radius: 18px !important;
    }

        .portal-shell .mud-paper.mud-paper-outlined {
            border-color: var(--p-line) !important;
            box-shadow: 0 1px 3px rgba(20, 30, 60, .05) !important;
        }

    .portal-shell .mud-elevation-1,
    .portal-shell .mud-elevation-2,
    .portal-shell .mud-elevation-3 {
        box-shadow: 0 1px 3px rgba(20, 30, 60, .05) !important;
        border: 1px solid var(--p-line);
    }

    /* Header — avatar em gradiente igual ao mock */
    .portal-shell .pm-avatar {
        width: 54px;
        height: 54px;
        border-radius: 16px;
        background: linear-gradient(135deg, var(--p-brand), var(--p-brand-dark));
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 19px;
        box-shadow: 0 6px 14px rgba(43, 80, 226, .35);
    }

    /* Botão principal (brand) — pill arredondado, sombra suave */
    .portal-shell .pm-brand-btn.mud-button-filled-primary,
    .portal-shell .pm-brand-btn {
        background: var(--p-brand) !important;
        color: #fff !important;
        border-radius: 12px !important;
        font-weight: 700 !important;
        text-transform: none !important;
        box-shadow: 0 8px 18px rgba(43, 80, 226, .28) !important;
    }

        .portal-shell .pm-brand-btn .mud-icon-root,
        .portal-shell .pm-brand-btn .mud-button-label {
            color: #fff !important;
        }

        .portal-shell .pm-brand-btn:hover {
            background: var(--p-brand-dark) !important;
        }

        .portal-shell .pm-brand-btn.mud-disabled,
        .portal-shell .pm-brand-btn:disabled {
            opacity: .6;
            color: #fff !important;
        }

    /* Botão secundário (tint) — usado em ações menores dentro dos cards */
    .portal-shell .pm-tint-btn {
        background: var(--p-brand-tint) !important;
        color: var(--p-brand-dark) !important;
        border-radius: 11px !important;
        font-weight: 700 !important;
        text-transform: none !important;
        box-shadow: none !important;
    }

        .portal-shell .pm-tint-btn .mud-icon-root,
        .portal-shell .pm-tint-btn .mud-button-label {
            color: var(--p-brand-dark) !important;
        }

        .portal-shell .pm-tint-btn:hover {
            background: var(--p-brand-soft) !important;
        }

    /* Botão outline — ex: "Reagendar" */
    .portal-shell .pm-outline-btn {
        border-radius: 12px !important;
        font-weight: 700 !important;
        text-transform: none !important;
        border-color: var(--p-line) !important;
        color: var(--p-ink) !important;
    }

    /* Tabs — vira o segmented control branco/pill do mock */
    .portal-shell .mud-tabs-toolbar {
        background: transparent !important;
        border-radius: 14px;
        padding: 4px;
        gap: 4px;
    }

        .portal-shell .mud-tabs-toolbar .mud-tab {
            border-radius: 11px !important;
            font-weight: 700 !important;
            text-transform: none !important;
            color: var(--p-muted) !important;
            transition: background .16s, color .16s;
        }

            .portal-shell .mud-tabs-toolbar .mud-tab.mud-tab-active {
                background: var(--p-brand) !important;
                color: #fff !important;
                box-shadow: 0 6px 14px rgba(43, 80, 226, .28);
            }

        .portal-shell .mud-tabs-toolbar .mud-tab-slider {
            display: none !important;
        }

    /* Chips: leve arredondamento extra, sem mudar as cores por tipo (mantém a
   sinalização por espécie/status que já existe e funciona bem) */
    .portal-shell .mud-chip {
        border-radius: 999px !important;
        font-weight: 700 !important;
    }

    /* Timeline: nó do ícone com leve sombra pra casar com o resto */
    .portal-shell .mud-timeline-item-dot {
        box-shadow: 0 2px 6px rgba(20, 30, 60, .12);
    }

    /* Ícone de acesso rápido (ex: "Meus dados" no header) */
    .portal-shell .pm-icon-btn {
        border: 1px solid var(--p-line) !important;
        border-radius: 13px !important;
    }

    /* === Card genérico (mesmo visual do pm-pet-card, usado em outras abas) === */
    .portal-shell .pm-card {
        border: 1px solid var(--p-line) !important;
        border-radius: 18px !important;
        box-shadow: 0 1px 3px rgba(20, 30, 60, .05) !important;
    }

    /* === Card de pet (aba Pets) === */
    .portal-shell .pm-pet-card {
        border: 1px solid var(--p-line) !important;
        border-radius: 18px !important;
        box-shadow: 0 1px 3px rgba(20, 30, 60, .05) !important;
        text-align: center;
        height: 100%;
    }

    .portal-shell .pm-pet-photo {
        width: 96px;
        height: 96px;
        border-radius: 50%;
        overflow: hidden;
        margin: 0 auto;
        border: 3px solid var(--p-brand-tint);
        box-shadow: 0 4px 12px rgba(20, 30, 60, .08);
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f5f5f5;
    }

        .portal-shell .pm-pet-photo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

    /* Painel tracejado "Adicionar pet" */
    .portal-shell .pm-add-pet {
        background: transparent;
        border: 2px dashed var(--p-brand-soft);
        border-radius: 18px;
        min-height: 240px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        color: var(--p-brand);
        cursor: pointer;
        text-align: center;
        padding: 22px;
    }

        .portal-shell .pm-add-pet:hover {
            background: var(--p-brand-tint);
            border-color: var(--p-brand);
        }

    .portal-shell .pm-add-pet-circle {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: var(--p-brand-soft);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--p-brand);
    }

    /* === Card "Próximo agendamento" === */
    .portal-shell .pm-upcoming {
        background: linear-gradient(120deg, var(--p-brand-tint), #fff 60%) !important;
        border: 1px solid var(--p-brand-soft) !important;
    }

    .portal-shell .pm-date-badge {
        width: 66px;
        height: 72px;
        border-radius: 16px;
        background: var(--p-brand);
        color: #fff;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .portal-shell .pm-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: var(--p-brand-soft);
        color: var(--p-brand-dark);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: .4px;
        padding: 4px 10px;
        border-radius: 999px;
        text-transform: uppercase;
    }

    /* === Chips reutilizáveis === */
    .portal-shell .pm-chip-brand {
        background: var(--p-brand-soft) !important;
        color: var(--p-brand-dark) !important;
    }

    .portal-shell .pm-chip-muted {
        background: #f1f3f8 !important;
        color: var(--p-muted) !important;
    }

    .portal-shell .pm-chip-warn {
        background: #fbeecb !important;
        color: #a5700a !important;
    }

    .portal-shell .pm-chip-done {
        background: #dcf3e6 !important;
        color: #177a4c !important;
    }

    /* === Meus dados — card hero (resumo do cliente) === */
    .portal-shell .pm-hero-card {
        background: linear-gradient(135deg, var(--p-brand), var(--p-brand-dark)) !important;
        border-radius: 18px !important;
        color: #fff;
    }

    .portal-shell .pm-hero-avatar {
        width: 56px;
        height: 56px;
        border-radius: 16px;
        background: rgba(255, 255, 255, .18);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 19px;
        color: #fff;
        flex-shrink: 0;
    }

    .portal-shell .pm-stat {
        flex: 1;
        background: rgba(255, 255, 255, .14);
        border-radius: 13px;
        padding: 13px;
        text-align: center;
    }

    /* === Toggle row (Meus dados — marketing) === */
    .portal-shell .pm-toggle-row {
        display: flex;
        align-items: center;
        gap: 13px;
        border: 1px solid var(--p-line);
        border-radius: 14px;
        padding: 14px 15px;
    }

    /* === Empty state genérico (Internação / Assinatura — sem dados reais ainda) === */
    .portal-shell .pm-empty-state {
        border: 1px dashed var(--p-line);
        border-radius: 16px;
        padding: 40px 24px;
        text-align: center;
        color: var(--p-muted);
        background: var(--p-brand-tint);
    }
