/* Reset Básico & Otimizações Globais para Mobile */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* Fundo da Página (SaaS Dark) */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0f172a;
    color: #f8fafc;
    padding: 16px 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Container do Formulário (Dark Card Ajustado) */
.container {
    background-color: #1e293b;
    padding: 28px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 420px;
    color: #ffffff;
    border: 1px solid #334155;
    overflow: hidden; /* Evita vazamento de conteúdo */
}

/* Cabeçalho */
.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 22px;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin-bottom: 4px;
}

.header p {
    font-size: 13.5px;
    color: #94a3b8;
    font-weight: 500;
}

/* NAVEGAÇÃO POR ABAS (NOVO AGENDAMENTO / MEUS AGENDAMENTOS) */
.abas-container {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    background-color: #0f172a;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #334155;
}

.btn-aba {
    flex: 1;
    height: 40px;
    background: transparent;
    border: none;
    color: #94a3b8;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.2s ease;
}

.btn-aba.ativa {
    background-color: #d97706;
    color: #ffffff;
}

/* Agrupamento dos Campos */
.form-group {
    margin-bottom: 16px;
    width: 100%;
}

/* Rótulos */
label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #cbd5e1;
    font-size: 13px;
    letter-spacing: -0.2px;
}

/* Inputs e Selects */
input, select {
    width: 100%;
    max-width: 100%;
    height: 44px;
    padding: 0 36px 0 14px; /* Espaço para a seta à direita */
    border: 1px solid #334155;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 500;
    color: #ffffff;
    background-color: #0f172a;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* Estilização Dark das opções do dropdown para Mobile e Desktop */
select option {
    background-color: #1e293b;
    color: #ffffff;
    padding: 10px;
    font-size: 14px;
}

.select-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.select-wrapper::after {
    content: "▼";
    font-size: 10px;
    color: #94a3b8;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Efeito ao Focar nos Inputs */
input:focus, select:focus {
    border-color: #f59e0b;
    background-color: #0f172a;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
    outline: none;
}

/* Grade Dinâmica de Botões de Horários */
.grade-horarios {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.btn-horario {
    height: 42px;
    background-color: #0f172a;
    border: 1px solid #334155;
    color: #e2e8f0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    transition: all 0.15s ease;
}

.btn-horario:hover {
    border-color: #475569;
    color: #ffffff;
}

.btn-horario:active {
    transform: scale(0.96);
}

.btn-horario.selecionado {
    background-color: #d97706;
    border-color: #f59e0b;
    color: #ffffff;
}

.btn-horario.ocupado {
    background-color: #1e293b;
    border-color: #334155;
    color: #64748b;
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.5;
}

.msg-alerta {
    color: #94a3b8;
    font-size: 13px;
    grid-column: 1 / -1;
    text-align: center;
    padding: 12px;
    background-color: #0f172a;
    border-radius: 8px;
    border: 1px dashed #334155;
    font-weight: 500;
}

/* Botão de Agendamento Primário */
.btn-agendar {
    width: 100%;
    height: 46px;
    background-color: #059669;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.2px;
    cursor: pointer;
    margin-top: 10px;
    touch-action: manipulation;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-agendar:hover {
    background-color: #047857;
}

.btn-agendar:active {
    transform: scale(0.98);
}

/* Ajuste em Telas Muito Pequenas (<360px) */
@media (max-width: 360px) {
    .container {
        padding: 20px 14px;
    }
    
    .grade-horarios {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- TOAST FLUTUANTE (MOBILE PREMIUM) --- */
.toast-notificacao {
    position: fixed;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 380px;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    opacity: 0;
}

.toast-notificacao.visivel {
    top: 20px;
    opacity: 1;
}

.toast-erro { background-color: #b91c1c; color: #ffffff; border: 1px solid #f87171; }
.toast-sucesso { background-color: #059669; color: #ffffff; border: 1px solid #34d399; }

/* --- CARD DE AGENDAMENTO ATIVO DO CLIENTE --- */
.card-agendamento-ativo {
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    margin-bottom: 16px;
    color: #f8fafc;
}

.card-agendamento-ativo p {
    font-size: 13.5px;
    margin-bottom: 6px;
    color: #cbd5e1;
}

.card-agendamento-ativo .titulo-ativo {
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 10px;
    font-size: 14.5px;
}

.btn-cancelar-ativo {
    width: 100%;
    height: 40px;
    background-color: #991b1b;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    margin-top: 10px;
    touch-action: manipulation;
    transition: all 0.2s ease;
}

.btn-cancelar-ativo:hover {
    background-color: #7f1d1d;
}

/* --- MODAL DE CONFIRMAÇÃO DE CANCELAMENTO --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-backdrop.visivel {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    color: #ffffff;
}

.modal-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #f87171;
}

.modal-card p {
    font-size: 14px;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.modal-acoes {
    display: flex;
    gap: 10px;
}

.btn-modal-cancelar {
    flex: 1;
    height: 42px;
    background-color: #0f172a;
    color: #cbd5e1;
    border: 1px solid #334155;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-modal-confirmar {
    flex: 1;
    height: 42px;
    background-color: #b91c1c;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* Força o calendário nativo a usar o tema escuro */
input[type="date"] {
    color-scheme: dark;
    background-color: #0f172a;
    color: #ffffff;
    border: 1px solid #334155;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 15px;
    width: 100%;
}

/* Customização do ícone de calendário nativo */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.8;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}