/* ==========================================================================
   Modo app (Fase 1): barra de abas, início em grade de ícones, página do
   serviço com botões de escolha e botão fixo. Mantém cores e marca do tema
   (--Main) e só muda o layout no celular; no computador quase nada muda.
   ========================================================================== */

:root {
    --app-nav-height: 64px;
    --app-radius: 16px;
    --app-soft: #eef4ff;
    --app-border: #e6ebf2;
    --app-text: #111;
    --app-muted: #6b7280;
}

/* Toques sem o destaque cinza e sem zoom por toque duplo */
a, button, label, input, select, textarea {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* -------------------------------------------------------------------------
   Barra de abas inferior (só celular)
   ------------------------------------------------------------------------- */
.app-bottom-nav {
    display: none;
}

@media (max-width: 767px) {
    body.has-app-nav .section-content-right {
        padding-bottom: calc(var(--app-nav-height) + env(safe-area-inset-bottom) + 16px);
    }

    /* O menu lateral (hambúrguer) fica só para o admin */
    body.has-app-nav .header-dashboard .button-show-hide {
        display: none !important;
    }

    .app-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        display: flex;
        justify-content: space-around;
        align-items: stretch;
        height: calc(var(--app-nav-height) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: #fff;
        border-top: 1px solid var(--app-border);
        box-shadow: 0 -4px 16px rgba(17, 24, 39, 0.06);
    }

    .app-bottom-nav__item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: var(--app-muted);
        font-size: 11px;
        font-weight: 500;
        text-decoration: none;
    }

    .app-bottom-nav__item.is-active {
        color: var(--Main);
        font-weight: 700;
    }

    .app-bottom-nav__icon {
        position: relative;
        font-size: 22px;
        line-height: 1;
    }

    .app-bottom-nav__badge {
        position: absolute;
        top: -6px;
        right: -12px;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9px;
        background: #dc3545;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        line-height: 18px;
        text-align: center;
        border: 2px solid #fff;
        box-sizing: content-box;
    }

    .app-hide-mobile {
        display: none !important;
    }
}

/* -------------------------------------------------------------------------
   Início do cliente: saudação, busca e grade de serviços
   ------------------------------------------------------------------------- */
.app-home {
    width: 100%;
}

.app-home__hello {
    margin-bottom: 16px;
}

.app-home__greeting {
    font-size: 15px;
    color: var(--app-muted);
}

.app-home__question {
    font-size: 22px;
    font-weight: 700;
    color: var(--app-text);
    line-height: 1.25;
}

.app-home__search {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0 16px;
    height: 48px;
    border-radius: 24px;
    background: #fff;
    border: 1px solid var(--app-border);
}

.app-home__search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--app-muted);
    font-size: 18px;
}

/* 16px evita o zoom automático do iOS ao focar; altura cheia deixa o cursor do tamanho certo */
.app-home__search input {
    flex: 1;
    height: 100% !important;
    border: 0 !important;
    padding: 0 !important;
    background: transparent;
    font-size: 16px !important;
    line-height: normal !important;
    color: var(--app-text);
    caret-color: var(--Main);
    outline: none;
    box-shadow: none !important;
}

.app-service-tile[hidden],
.app-home__empty[hidden] {
    display: none !important;
}

.app-home__section-title {
    margin-bottom: 12px;
    font-size: 17px;
    font-weight: 700;
    color: var(--app-text);
}

.app-home__empty {
    padding: 24px;
    text-align: center;
    color: var(--app-muted);
}

.app-service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.app-service-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 14px;
    border-radius: var(--app-radius);
    background: #fff;
    border: 1px solid var(--app-border);
    text-align: center;
    text-decoration: none;
    color: var(--app-text);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.app-service-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
    color: var(--app-text);
}

.app-service-tile:active {
    transform: scale(0.97);
}

.app-service-tile__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--app-soft);
}

.app-service-tile__icon img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.app-service-tile__name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

.app-service-tile__desc {
    font-size: 13px;
    line-height: 1.4;
    color: var(--app-muted);
}

.app-service-tile__price {
    margin-top: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--Main);
}

@media (max-width: 767px) {
    .app-home__search {
        display: flex;
    }

    /* A busca do cabeçalho some no celular (fica a da página) */
    body.has-app-nav .header-dashboard .form-search {
        display: none !important;
    }

    .app-service-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .app-service-tile {
        padding: 14px 6px;
        gap: 6px;
        border-radius: 14px;
    }

    .app-service-tile__icon {
        width: 58px;
        height: 58px;
    }

    .app-service-tile__icon img {
        width: 36px;
        height: 36px;
    }

    .app-service-tile__name {
        font-size: 12px;
    }

    .app-service-tile__desc {
        display: none;
    }

    .app-service-tile__price {
        font-size: 11px;
    }
}

@media (max-width: 359px) {
    .app-service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* -------------------------------------------------------------------------
   Página do serviço
   ------------------------------------------------------------------------- */
.app-service-hero {
    display: none;
}

@media (max-width: 767px) {
    .app-service-hero {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        margin: 0 0 8px;
        padding: 20px 16px;
        border-radius: var(--app-radius);
        background: linear-gradient(180deg, var(--app-soft) 0%, #fff 100%);
        text-align: center;
    }

    .app-service-hero__icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 84px;
        height: 84px;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 6px 18px rgba(34, 117, 252, 0.15);
    }

    .app-service-hero__icon img {
        width: 52px;
        height: 52px;
        object-fit: contain;
    }

    .app-service-hero__title {
        margin: 6px 0 0;
        font-size: 21px;
        font-weight: 700;
        line-height: 1.25;
        color: var(--app-text);
    }

    .app-service-hero__price {
        font-size: 14px;
        font-weight: 600;
        color: var(--Main);
    }

    /* Foto grande só no computador */
    .header-section {
        display: none;
    }
}

/* Botões de escolha (tipologia, tipo de limpeza, horários) */
.app-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.app-chips--equal .app-chip {
    flex: 1 1 0;
}

.app-chips--times {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
}

.app-chip {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.app-chip input,
.app-day-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.app-chip span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: var(--app-text);
    text-align: center;
    transition: all 0.15s ease;
}

.app-chip input:checked + span,
.app-day-chip input:checked + span {
    border-color: var(--Main);
    background: var(--Main);
    color: #fff;
}

.app-chip input:focus-visible + span,
.app-day-chip input:focus-visible + span {
    outline: 2px solid var(--Main);
    outline-offset: 2px;
}

.app-chips.is-invalid .app-chip span,
.app-day-scroller.is-invalid .app-day-chip span {
    border-color: #dc3545;
}

/* Dias: faixa com rolagem horizontal */
.app-day-scroller {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.app-day-scroller::-webkit-scrollbar {
    display: none;
}

.app-day-chip {
    position: relative;
    flex: 0 0 auto;
    margin: 0;
    cursor: pointer;
    scroll-snap-align: start;
}

.app-day-chip span {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: 60px;
    padding: 6px 10px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: #fff;
    color: var(--app-text);
    transition: all 0.15s ease;
}

.app-day-chip strong {
    font-size: 14px;
    font-weight: 700;
}

.app-day-chip small {
    font-size: 12px;
    opacity: 0.8;
}

.app-other-date {
    margin-top: 8px;
}

/* Campo numérico com - e + */
.app-stepper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-stepper input {
    flex: 0 0 90px;
    width: 90px !important;
    text-align: center;
    font-size: 18px !important;
    font-weight: 700 !important;
    -moz-appearance: textfield;
}

.app-stepper input::-webkit-outer-spin-button,
.app-stepper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.app-stepper__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--app-border);
    background: #fff;
    color: var(--Main);
    font-size: 18px;
}

.app-stepper__btn:active {
    background: var(--app-soft);
}

/* Botão principal fixo no rodapé (celular), acima da barra de abas */
.app-sticky-cta__price {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.app-sticky-cta__price[hidden] {
    display: none;
}

.app-sticky-cta__price small {
    font-size: 12px;
    color: var(--app-muted);
}

.app-sticky-cta__price strong {
    font-size: 18px;
    color: var(--app-text);
}

@media (max-width: 767px) {
    .app-sticky-cta {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: #fff;
        border-top: 1px solid var(--app-border);
        box-shadow: 0 -4px 16px rgba(17, 24, 39, 0.06);
    }

    body.has-app-nav .app-sticky-cta {
        bottom: calc(var(--app-nav-height) + env(safe-area-inset-bottom));
        padding-bottom: 12px;
    }

    .app-sticky-cta .tf-button {
        flex: 1;
        height: 50px;
        border-radius: 25px;
    }

    /* Espaço para o botão fixo não cobrir o fim do formulário */
    .find-more-form {
        padding-bottom: 84px;
    }
}

@media (min-width: 768px) {
    .app-sticky-cta {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

/* O tema força display:block nos campos do formulário; o atributo hidden precisa vencer */
.find-more-form .app-other-date[hidden] {
    display: none !important;
}

/* -------------------------------------------------------------------------
   Barra de carregamento no topo (troca de página / envio de formulário)
   ------------------------------------------------------------------------- */
.app-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    width: 0;
    height: 3px;
    background: var(--Main);
    box-shadow: 0 0 8px rgba(34, 117, 252, 0.6);
    opacity: 0;
    pointer-events: none;
}

.app-page-loader.is-loading {
    opacity: 1;
    /* Avança rápido no início e desacelera até 90%: a página nova substitui a barra */
    animation: app-page-loader 8s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
}

@keyframes app-page-loader {
    0% { width: 0; }
    15% { width: 45%; }
    50% { width: 75%; }
    100% { width: 90%; }
}

@media (prefers-reduced-motion: reduce) {
    .app-page-loader.is-loading {
        animation: none;
        width: 90%;
    }
}

/* -------------------------------------------------------------------------
   Pedido antes do pagamento: resumo de valores, métodos e política
   ------------------------------------------------------------------------- */
.app-price-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-price-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    font-size: 14px;
    color: var(--app-text);
    border-bottom: 1px solid var(--app-border);
}

.app-price-list li span:last-child {
    white-space: nowrap;
    font-weight: 600;
}

.app-price-list__included {
    color: #198754;
}

.app-price-list .app-price-list__total {
    border-bottom: 0;
    font-size: 17px;
    font-weight: 700;
}

.app-price-list .app-price-list__total span:last-child {
    color: var(--Main);
    font-weight: 800;
}

.payment-option .payment-text small {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--app-muted);
}

.app-policy-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.app-policy-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.45;
    color: var(--app-text);
}

.app-policy-list i {
    flex: 0 0 auto;
    margin-top: 2px;
    font-size: 18px;
    color: var(--Main);
}

.app-policy-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--Main);
}

.app-checkout-note .body-title i {
    margin-right: 6px;
    color: var(--Main);
}

#payment-method-error[hidden] {
    display: none !important;
}

@media (max-width: 767px) {
    /* Métodos de pagamento em linhas largas, mais fáceis de tocar */
    .payment-container {
        flex-direction: column;
        gap: 10px !important;
    }

    .payment-container .payment-option {
        flex-direction: row;
        justify-content: flex-start;
        gap: 14px;
        width: 100% !important;
        height: auto !important;
        padding: 14px 16px !important;
        text-align: left !important;
    }

    .payment-container .payment-option:hover {
        transform: none !important;
    }

    .payment-container .payment-text {
        margin-top: 0 !important;
    }

    .payment-container .payment-icon img {
        width: 44px !important;
    }

    /* O resumo do pedido no celular: espaço para o botão fixo */
    #order-payment-form {
        padding-bottom: 84px;
    }
}

@media (max-width: 767px) {
    /* Quando o botão fixo também é um wg-box (tela do pedido), mantém preço e botão lado a lado */
    .wg-box.app-sticky-cta {
        flex-direction: row !important;
        align-items: center !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
}

/* -------------------------------------------------------------------------
   Consentimento no pagamento, avaliação e garantia
   ------------------------------------------------------------------------- */
.app-waiver {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 8px;
    padding: 14px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: var(--app-soft);
    font-size: 13px;
    line-height: 1.45;
    color: var(--app-text);
    cursor: pointer;
}

.app-waiver input {
    flex: 0 0 auto;
    width: 20px !important;
    height: 20px !important;
    margin-top: 1px;
    accent-color: var(--Main);
}

.app-waiver.is-invalid {
    border-color: #dc3545;
}

/* Estrelas: radios em ordem 5..1 e row-reverse, para o hover/checked pintar as anteriores */
.app-star-input {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 6px;
}

.app-star-input input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.app-star-input label {
    font-size: 36px;
    line-height: 1;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
}

.app-star-input label:hover,
.app-star-input label:hover ~ label,
.app-star-input input:checked ~ label {
    color: #f5a623;
}

.app-star-input input:focus-visible + label {
    outline: 2px solid var(--Main);
    outline-offset: 2px;
    border-radius: 4px;
}

.app-review-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-stars {
    font-size: 22px;
    letter-spacing: 2px;
    color: #f5a623;
}

.app-complaint-status {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff8e6;
}

.app-complaint-text {
    padding: 12px;
    border-radius: 10px;
    background: #f8f9fb;
    white-space: pre-line;
}

.app-complete-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

/* -------------------------------------------------------------------------
   Dia do serviço: botões do profissional e linha do tempo do cliente
   ------------------------------------------------------------------------- */
.app-journey-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.app-journey-done {
    font-size: 13px;
    font-weight: 600;
    color: #198754;
}

.app-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.app-timeline__step {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 16px;
    color: var(--app-muted);
}

.app-timeline__step:last-child {
    padding-bottom: 0;
}

/* Linha vertical entre as bolinhas */
.app-timeline__step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 32px;
    bottom: 0;
    width: 2px;
    background: var(--app-border);
}

.app-timeline__step.is-done:not(.is-current)::after {
    background: var(--Main);
}

.app-timeline__dot {
    display: flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--app-border);
    background: #fff;
    font-size: 14px;
}

.app-timeline__step.is-done .app-timeline__dot {
    border-color: var(--Main);
    background: var(--Main);
    color: #fff;
}

.app-timeline__step.is-current .app-timeline__dot {
    box-shadow: 0 0 0 4px rgba(34, 117, 252, 0.18);
}

.app-timeline__label {
    display: flex;
    flex-direction: column;
    padding-top: 5px;
    font-size: 14px;
    font-weight: 600;
}

.app-timeline__step.is-done .app-timeline__label {
    color: var(--app-text);
}

.app-timeline__label small {
    font-size: 12px;
    font-weight: 400;
    color: var(--app-muted);
}

.app-chip.is-disabled span {
    opacity: 0.35;
    text-decoration: line-through;
    cursor: not-allowed;
}

/* -------------------------------------------------------------------------
   Listas no estilo app: cabeçalho, filtros, cartões de pedido, estado vazio
   ------------------------------------------------------------------------- */
.app-page-head {
    margin-bottom: 16px;
}

.app-page-head h3 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
}

.app-page-head .body-text {
    color: var(--app-muted);
}

.app-filter-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

.app-filter-chips::-webkit-scrollbar {
    display: none;
}

.app-filter-chip {
    flex: 0 0 auto;
    padding: 10px 18px;
    border: 1px solid var(--app-border);
    border-radius: 22px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: var(--app-text);
    text-decoration: none;
}

.app-filter-chip.is-active {
    border-color: var(--Main);
    background: var(--Main);
    color: #fff;
}

.app-card-group {
    margin-bottom: 14px;
}

.app-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: #fff;
}

.app-card-group > .app-card:not(:last-child) {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* O cartão inteiro é clicável (link por cima), sem atrapalhar os botões */
.app-card__link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.app-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-card__icon {
    display: flex;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--app-soft);
}

.app-card__icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.app-card__title {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
}

.app-card__title strong {
    font-size: 15px;
    line-height: 1.3;
    color: var(--app-text);
}

.app-card__title span {
    font-size: 12px;
    color: var(--app-muted);
}

.app-card__facts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    color: var(--app-text);
}

.app-card__facts i {
    width: 18px;
    margin-right: 6px;
    color: var(--Main);
}

.app-card__actions,
.app-card-actions {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-card__actions form,
.app-card-actions form {
    margin: 0;
}

.app-card-group > .app-card-actions {
    padding: 12px 16px 16px;
    border: 1px solid var(--app-border);
    border-top: 0;
    border-radius: 0 0 var(--app-radius) var(--app-radius);
    background: #fafbfd;
}

.app-card-actions--split {
    flex-direction: row;
}

.app-card-actions--split > * {
    flex: 1;
}

.app-card__reject {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-button-danger {
    color: #dc3545 !important;
    border-color: #f1c0c5 !important;
}

/* Estado do pedido */
.app-status {
    flex: 0 0 auto;
    max-width: 45%;
    padding: 5px 10px;
    border-radius: 14px;
    background: #eef1f5;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    color: #4b5563;
}

.app-status--awaiting_payment,
.app-status--awaiting_quote,
.app-status--pending {
    background: #fff4e5;
    color: #b45309;
}

.app-status--finding_professional {
    background: #eef4ff;
    color: #1d4ed8;
}

.app-status--professional_confirmed,
.app-status--accepted,
.app-status--on_the_way,
.app-status--arrived {
    background: #e7f8ef;
    color: #15803d;
}

.app-status--completed {
    background: #ecfdf3;
    color: #166534;
}

.app-status--cancelled,
.app-status--rejected {
    background: #fdecee;
    color: #b42318;
}

.app-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 36px 20px;
    border-radius: var(--app-radius);
    background: #fff;
    text-align: center;
    color: var(--app-muted);
}

.app-empty i {
    font-size: 40px;
    color: #c7cfdb;
}

.app-empty strong {
    font-size: 16px;
    color: var(--app-text);
}

/* -------------------------------------------------------------------------
   Janela de confirmação/aviso (substitui confirm()/alert())
   ------------------------------------------------------------------------- */
.app-confirm {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 24, 39, 0.45);
}

.app-confirm[hidden] {
    display: none;
}

.app-confirm__box {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 20px 40px rgba(17, 24, 39, 0.25);
}

.app-confirm__message {
    margin: 0 0 18px;
    font-size: 16px;
    line-height: 1.45;
    color: var(--app-text);
}

.app-confirm__actions {
    display: flex;
    gap: 10px;
}

.app-confirm__actions .tf-button {
    flex: 1;
}

.app-confirm__actions [hidden] {
    display: none;
}

@media (min-width: 768px) {
    .app-confirm {
        align-items: center;
    }
}

body.app-confirm-open {
    overflow: hidden;
}

.app-push-hint {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fff8e6;
    color: #7a4b00;
    font-size: 14px;
    line-height: 1.45;
}

.app-push-hint i {
    font-size: 22px;
    color: #d97706;
}

.app-push-hint strong {
    display: block;
    margin-bottom: 2px;
}

/* Tela "confirme o seu e-mail" (layout de convidado, igual ao login) */
.app-verify-box {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.app-verify-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--app-soft);
    font-size: 28px;
    color: var(--Main);
}

.app-verify-sent {
    padding: 12px 14px;
    border-radius: 12px;
    background: #e7f8ef;
    color: #15803d;
    font-size: 14px;
    font-weight: 600;
}

.app-verify-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--app-text);
}

.app-verify-spam {
    font-size: 13px;
    color: var(--app-muted);
}

.app-link-button {
    padding: 8px;
    border: 0;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--app-muted);
    text-decoration: underline;
}

/* -------------------------------------------------------------------------
   Selects do Bootstrap (form-select/custom-select) com o mesmo visual dos inputs
   do tema: no perfil e no cadastro do profissional ficavam pequenos e diferentes
   ------------------------------------------------------------------------- */
.form-style-2 select.form-select,
.form-style-2 select.custom-select,
form select.form-select {
    width: 100%;
    min-height: 50px;
    padding: 14px 44px 14px 22px;
    border: 1px solid var(--Input, #ECF0F4);
    border-radius: 12px;
    background-color: #fff;
    background-position: right 18px center;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 20px;
    color: var(--Heading, #111);
    box-shadow: none;
}

.form-style-2 select.form-select:focus,
form select.form-select:focus {
    border-color: var(--Main);
    box-shadow: none;
}

/* iOS dá zoom ao focar campos com menos de 16px: no celular os campos usam 16px */
@media (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* -------------------------------------------------------------------------
   Cadastro do profissional: dias/período em botões, lista de documentos
   ------------------------------------------------------------------------- */
.app-chips--days .app-chip {
    flex: 1 1 calc(33% - 8px);
}

.app-chips--periods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.app-chips--periods .app-chip span {
    flex-direction: column;
    gap: 2px;
    min-height: 58px;
}

.app-chips--periods small {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.8;
}

.app-chip input[type="checkbox"]:checked + span {
    border-color: var(--Main);
    background: var(--Main);
    color: #fff;
}

.app-progress {
    height: 8px;
    border-radius: 4px;
    background: #e6ebf2;
    overflow: hidden;
}

.app-progress span {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--Main);
    transition: width 0.3s ease;
}

.app-doc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.app-doc {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: #fff;
}

.app-doc__icon {
    display: flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f3f7;
    font-size: 18px;
    color: var(--app-muted);
}

.app-doc.is-sent .app-doc__icon {
    background: #fff4e5;
    color: #b45309;
}

.app-doc.is-approved .app-doc__icon {
    background: #e7f8ef;
    color: #15803d;
}

.app-doc__body {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    font-size: 14px;
}

.app-doc__body strong {
    line-height: 1.3;
    color: var(--app-text);
}

.app-doc__body span {
    font-size: 12px;
    color: var(--app-muted);
}

.app-doc__form {
    margin: 0;
}

.app-doc__button {
    position: relative;
    height: 40px !important;
    padding: 0 14px !important;
    font-size: 13px !important;
    cursor: pointer;
}

.app-doc__button input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.app-doc__busy {
    display: none;
}

.app-doc__form.is-busy .app-doc__idle {
    display: none;
}

.app-doc__form.is-busy .app-doc__busy {
    display: inline;
}

.app-doc__form.is-busy .app-doc__button {
    opacity: 0.7;
    pointer-events: none;
}

/* Select2 (regiões): etiquetas no padrão dos botões, sem o "x)" quebrado */
.select2-container--default .select2-selection--multiple {
    min-height: 54px !important;
    border-radius: 12px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    position: relative;
    padding: 6px 10px 6px 28px !important;
    border: 1px solid var(--Main) !important;
    border-radius: 16px !important;
    background: var(--app-soft) !important;
    font-size: 13px;
    font-weight: 600;
    color: var(--app-text) !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    position: absolute !important;
    left: 6px !important;
    top: 50% !important;
    width: 18px;
    height: 18px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50%;
    background: #fff !important;
    font-size: 14px !important;
    line-height: 18px !important;
    text-align: center;
    color: #dc3545 !important;
    transform: translateY(-50%);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove span {
    display: inline-block;
    line-height: 18px;
}

/* Profissional: botões para ir até ao cliente */
.app-card__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.app-nav-button {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: var(--app-soft);
    font-size: 14px;
    font-weight: 600;
    color: var(--Main);
    text-decoration: none;
    white-space: nowrap;
}

.app-nav-button:active {
    background: #dde8ff;
}

.app-card__notes {
    padding: 8px 10px;
    border-radius: 10px;
    background: #f8f9fb;
    font-size: 13px;
    color: var(--app-muted);
}

/* Agenda agrupada por dia */
.app-day-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 20px 2px 10px;
}

.app-day-header:first-of-type {
    margin-top: 4px;
}

.app-day-header strong {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: var(--app-text);
}

.app-day-header span {
    font-size: 13px;
    color: var(--app-muted);
}

.app-day-header.is-today strong {
    color: var(--Main);
}

.app-day-header.is-past strong {
    color: #b45309;
}

.app-day-header__count {
    padding: 4px 10px;
    border-radius: 12px;
    background: #eef1f5;
    font-size: 12px !important;
    font-weight: 600;
    white-space: nowrap;
}

/* -------------------------------------------------------------------------
   Pesquisa de morada (Google) + mapa com pino
   ------------------------------------------------------------------------- */
.app-address-search {
    position: relative;
}

.app-address-search__box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid var(--Main);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(34, 117, 252, 0.08);
}

.app-address-search__box i {
    font-size: 18px;
    color: var(--Main);
}

.app-address-search__box input {
    flex: 1;
    height: 48px;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none;
    font-size: 16px;
}

.app-address-search__list {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    margin: 6px 0 0;
    padding: 6px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(17, 24, 39, 0.12);
    list-style: none;
}

.app-address-search__list[hidden] {
    display: none;
}

.app-address-search__list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
}

.app-address-search__list li:hover,
.app-address-search__list li:active {
    background: var(--app-soft);
}

.app-address-search__list li i {
    margin-top: 2px;
    color: var(--Main);
}

.app-address-search__list li span {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 1.3;
}

.app-address-search__list li small {
    font-size: 12px;
    color: var(--app-muted);
}

.app-address-search__hint,
.app-address-search__pin-hint {
    margin-top: 6px;
    font-size: 12px !important;
    color: var(--app-muted) !important;
}

.app-address-search__map {
    height: 220px;
    margin-top: 12px;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    overflow: hidden;
}

.app-address-search__map[hidden],
.app-address-search__pin-hint[hidden] {
    display: none;
}
