/* ═══════════════════════════════════════════════════════════
   AgendaGo – Área do cliente
   Agenda pública, login do cliente, meus agendamentos e loja.
   Usa a paleta MudBlazor + tokens --ag-* (admin.css), então
   acompanha o tema claro/escuro.
   ═══════════════════════════════════════════════════════════ */

.cl-page {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100vw;
    /* clip (e não hidden) para não quebrar o cabeçalho e os botões "sticky" */
    overflow-x: clip;
    background: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ─────────────── cabeçalho da unidade ─────────────── */
.cl-header {
    position: sticky;
    top: 0;
    padding-top: env(safe-area-inset-top);
    z-index: 50;
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--ag-line);
}

.cl-header-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.cl-brand {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none !important;
    color: inherit !important;
}

.cl-brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    flex-shrink: 0;
    object-fit: cover;
    background: var(--ag-soft);
    border: 1px solid var(--ag-line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mud-palette-primary);
    font-weight: 700;
    overflow: hidden;
}

    .cl-brand-logo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.cl-brand-name {
    font-weight: 700;
    font-size: .98rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-brand-sub {
    font-size: .74rem;
    color: var(--mud-palette-text-secondary);
}

.cl-nav {
    display: flex;
    gap: 4px;
    margin-left: 12px;
}

    .cl-nav a {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        border-radius: 10px;
        font-size: .86rem;
        font-weight: 600;
        color: var(--mud-palette-text-secondary) !important;
        text-decoration: none !important;
        transition: background .15s, color .15s;
    }

        .cl-nav a:hover {
            background: var(--ag-soft);
            color: var(--mud-palette-text-primary) !important;
        }

        .cl-nav a.active {
            background: var(--ag-primary-soft);
            color: var(--mud-palette-primary) !important;
        }

.cl-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cl-points-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(201, 150, 46, .14);
    color: var(--mud-palette-secondary);
    font-weight: 700;
    font-size: .85rem;
    white-space: nowrap;
    text-decoration: none !important;
}

.cl-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--mud-palette-primary);
    color: #fff !important;
    font-weight: 600;
    font-size: .86rem;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
    transition: transform .15s, box-shadow .15s;
}

    .cl-btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(var(--mud-palette-primary-rgb), .3);
    }

    .cl-btn-primary:disabled {
        opacity: .5;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

.cl-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--ag-line);
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary) !important;
    font-weight: 600;
    font-size: .82rem;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background .15s;
}

    .cl-btn-ghost:hover {
        background: var(--ag-soft);
    }

    .cl-btn-ghost.danger {
        color: var(--mud-palette-error) !important;
    }

        .cl-btn-ghost.danger:hover {
            background: var(--ag-error-soft);
        }

    .cl-btn-ghost:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

/* ─────────────── corpo ─────────────── */
.cl-body {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 20px 96px;
}

.cl-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0;
}

.cl-sub {
    font-size: .88rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 4px;
}

.cl-card {
    background: var(--mud-palette-surface);
    border: 1px solid var(--ag-line);
    border-radius: 20px;
    box-shadow: var(--ag-shadow);
}

.cl-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 28px 0 12px;
    font-size: 1.05rem;
    font-weight: 700;
}

/* abas segmentadas */
.cl-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: var(--ag-soft);
    border: 1px solid var(--ag-line);
    max-width: 100%;
    overflow-x: auto;
}

.cl-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

    .cl-tab.active {
        background: var(--mud-palette-surface);
        color: var(--mud-palette-text-primary);
        box-shadow: 0 1px 3px rgba(21, 20, 43, .08);
    }

.cl-tab-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--ag-primary-soft);
    color: var(--mud-palette-primary);
    font-size: .7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* estado vazio */
.cl-empty {
    text-align: center;
    padding: 48px 20px;
}

.cl-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 18px;
    background: var(--ag-primary-soft);
    color: var(--mud-palette-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cl-empty-title {
    font-weight: 700;
    font-size: 1rem;
}

.cl-empty-text {
    font-size: .85rem;
    color: var(--mud-palette-text-secondary);
    margin: 4px 0 18px;
}

/* badge de status */
.cl-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}

    .cl-status.success { background: var(--ag-success-soft); color: #16A34A; }
    .cl-status.error   { background: var(--ag-error-soft);   color: #EF4444; }
    .cl-status.warning { background: var(--ag-warning-soft); color: #D97706; }
    .cl-status.info    { background: var(--ag-info-soft);    color: #0891B2; }
    .cl-status.primary { background: var(--ag-primary-soft); color: var(--mud-palette-primary); }
    .cl-status.neutral { background: var(--ag-soft);         color: var(--mud-palette-text-secondary); }

/* navegação inferior (mobile) */
.cl-bottom-nav {
    display: none;
}

@media (max-width: 760px) {
    .cl-nav,
    .cl-header-actions .cl-btn-primary,
    .cl-header-actions .cl-hide-mobile {
        display: none;
    }

    .cl-header-inner {
        padding: 10px 16px;
    }

    .cl-body {
        padding: 20px 16px 104px;
    }

    .cl-title {
        font-size: 1.35rem;
    }

    .cl-bottom-nav {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        background: var(--mud-palette-surface);
        border-top: 1px solid var(--ag-line);
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    }

        .cl-bottom-nav a {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            padding: 6px 4px;
            border-radius: 12px;
            font-size: .7rem;
            font-weight: 600;
            color: var(--mud-palette-text-secondary) !important;
            text-decoration: none !important;
        }

            .cl-bottom-nav a.active {
                color: var(--mud-palette-primary) !important;
            }

            .cl-bottom-nav a.cta .cl-bottom-cta {
                width: 46px;
                height: 46px;
                margin-top: -22px;
                border-radius: 50%;
                background: var(--mud-palette-primary);
                color: #fff;
                display: flex;
                align-items: center;
                justify-content: center;
                box-shadow: 0 8px 20px rgba(var(--mud-palette-primary-rgb), .35);
                border: 4px solid var(--mud-palette-surface);
            }
}


/* ═══════════════ App da unidade (PWA): convite e aviso de notificação ═══════════════ */
.pwa-convite {
    position: fixed; left: 50%; bottom: 16px; z-index: 1300; width: min(440px, calc(100% - 32px));
    transform: translateX(-50%); padding: 16px 16px 14px; border-radius: 20px; background: #fff; color: #15142B;
    box-shadow: 0 24px 60px rgba(21, 20, 43, .22); border: 1px solid #ECEBF3;
    animation: pwa-sobe .35s cubic-bezier(.2, .8, .2, 1);
}
.pwa-convite.saindo { opacity: 0; transform: translate(-50%, 20px); transition: all .25s ease; }
@keyframes pwa-sobe { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translate(-50%, 0); } }
.pwa-fechar { position: absolute; top: 8px; right: 10px; border: 0; background: transparent; font-size: 1.4rem; line-height: 1;
    color: #9CA3AF; cursor: pointer; }
.pwa-linha { display: flex; align-items: center; gap: 12px; padding-right: 18px; }
.pwa-linha.icone-direita { flex-direction: row-reverse; }
.pwa-icone { width: 52px; height: 52px; border-radius: 14px; object-fit: contain; background: #fff; border: 1px solid #ECEBF3; flex-shrink: 0; }
.pwa-texto { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pwa-texto b { font-size: .95rem; }
.pwa-texto span { font-size: .82rem; color: #6B7280; line-height: 1.45; }
.pwa-ios { margin-top: 10px; padding: 8px 10px; border-radius: 12px; background: #F5F5F9; font-size: .8rem; color: #3A3A55; }
.pwa-ios-ic { display: inline-block; padding: 0 4px; font-weight: 700; color: var(--pwa-cor, #5B3DF5); }
.pwa-acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.pwa-btn { border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 600; font-size: .86rem; cursor: pointer;
    background: var(--pwa-cor, #5B3DF5); color: #fff; box-shadow: 0 8px 18px rgba(91, 61, 245, .25); }
.pwa-btn.secundario { background: #fff; color: var(--pwa-cor, #5B3DF5); border: 1px solid var(--pwa-cor, #5B3DF5); box-shadow: none; }
.pwa-btn:disabled { opacity: .7; cursor: default; }
.pwa-agora-nao { border: 0; background: transparent; color: #6B7280; font-size: .82rem; cursor: pointer; margin-left: auto; }

.pwa-aviso {
    position: fixed; top: 16px; left: 50%; z-index: 2000; width: min(420px, calc(100% - 32px));
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #fff; color: #15142B;
    border-left: 4px solid var(--pwa-cor, #5B3DF5); box-shadow: 0 18px 44px rgba(21, 20, 43, .2); cursor: pointer;
    opacity: 0; transform: translate(-50%, -20px); transition: opacity .3s ease, transform .3s ease;
}
.pwa-aviso.on { opacity: 1; transform: translate(-50%, 0); }
.pwa-aviso.icone-direita { flex-direction: row-reverse; border-left: 0; border-right: 4px solid var(--pwa-cor, #5B3DF5); }
.pwa-aviso img { width: 42px; height: 42px; border-radius: 12px; object-fit: contain; flex-shrink: 0; }
.pwa-aviso div { display: flex; flex-direction: column; min-width: 0; }
.pwa-aviso b { font-size: .9rem; }
.pwa-aviso span { font-size: .8rem; color: #6B7280; }
@media (prefers-reduced-motion: reduce) { .pwa-convite, .pwa-aviso { animation: none; transition: none; } }

/* No celular o convite do app vai para o topo, para não cobrir os botões "Voltar/Continuar" */
@media (max-width: 600px) {
    .pwa-convite {
        top: calc(8px + env(safe-area-inset-top)); bottom: auto; width: calc(100% - 20px);
        padding: 12px 12px 10px; border-radius: 16px; animation-name: pwa-desce;
    }
    .pwa-convite.saindo { transform: translate(-50%, -20px); }
    .pwa-icone { width: 42px; height: 42px; }
    .pwa-texto span { font-size: .78rem; }
    .pwa-acoes { margin-top: 10px; }
    .pwa-btn { flex: 1; padding: 9px 12px; }
}
@keyframes pwa-desce { from { opacity: 0; transform: translate(-50%, -24px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* App instalado (PWA): desliga o "puxar para atualizar" do Chrome, que recarregava a tela sem querer */
@media (display-mode: standalone) {
    html, body { overscroll-behavior-y: none; }
}

.pwa-email { display: flex; gap: 8px; margin-top: 12px; }
.pwa-email input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid #DCDAE8;
    font-size: 16px; /* 16px evita o zoom automático do iPhone */ color: #15142B; background: #fff; }
.pwa-email input:focus { outline: none; border-color: var(--pwa-cor, #5B3DF5); }


/* ═══════════ Telas do cliente com cara de app nativo ═══════════
   Sem barra de rolagem visível (a rolagem continua funcionando), sem o realce azul ao tocar
   e sem a espera do "toque duplo para zoom". Vale para a agenda pública e a área do cliente. */
html:has(.cl-page), html:has(.cl-page) body { scrollbar-width: none; -ms-overflow-style: none; }
html:has(.cl-page)::-webkit-scrollbar, html:has(.cl-page) body::-webkit-scrollbar,
.cl-page *::-webkit-scrollbar { width: 0; height: 0; display: none; }
.cl-page, .cl-page * { scrollbar-width: none; }
.cl-page { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.cl-page button, .cl-page a { -webkit-user-select: none; user-select: none; }
.cl-page input, .cl-page textarea { -webkit-user-select: text; user-select: text; }
html:has(.cl-page) { background: var(--mud-palette-background); }
