/* AgendaPro — Frontend CSS (mobile-first) */

:root {
    --ap-primary: #2563eb;
    --ap-success: #16a34a;
    --ap-danger:  #dc2626;
    --ap-gray:    #6b7280;
    --ap-light:   #f3f4f6;
    --ap-border:  #e5e7eb;
    --ap-radius:  12px;
    --ap-shadow:  0 2px 12px rgba(0,0,0,.08);
}

.agendapro-booking {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #111827;
}

/* Steps */
.ap-step          { display: none; }
.ap-step.active   { display: block; animation: apIn .25s ease; }
@keyframes apIn   { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

.ap-step-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 16px;
}

.ap-back {
    background: none;
    border: none;
    color: var(--ap-primary);
    font-size: .875rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 12px;
    display: inline-block;
}

/* Serviços */
.ap-services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 480px) {
    .ap-services-grid { grid-template-columns: 1fr 1fr; }
}

.ap-service-card {
    background: #fff;
    border: 1.5px solid var(--ap-border);
    border-radius: var(--ap-radius);
    padding: 16px;
    cursor: pointer;
    transition: box-shadow .2s, transform .15s, border-color .15s;
    box-shadow: var(--ap-shadow);
}
.ap-service-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    transform: translateY(-2px);
    border-color: var(--ap-primary);
}
.ap-service-card h3 { margin: 0 0 6px; font-size: 1rem; font-weight: 700; }
.ap-service-card p  { margin: 0 0 10px; font-size: .875rem; color: var(--ap-gray); line-height: 1.4; }
.ap-svc-meta        { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--ap-gray); }
.ap-price           { font-weight: 700; color: var(--ap-primary); font-size: .95rem; }

/* Calendário */
.ap-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 12px;
    font-weight: 700;
    font-size: 1rem;
}
.ap-calendar-nav button {
    background: var(--ap-light);
    border: 1px solid var(--ap-border);
    border-radius: 8px;
    width: 36px; height: 36px;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    transition: background .15s;
}
.ap-calendar-nav button:hover { background: var(--ap-border); }

.ap-cal-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: .72rem;
    font-weight: 600;
    color: var(--ap-gray);
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 4px;
}

.ap-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.ap-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: .9rem;
    cursor: pointer;
    transition: background .12s, color .12s;
    user-select: none;
}
.ap-day:not(.disabled):hover { background: #dbeafe; color: var(--ap-primary); }
.ap-day.selected { background: var(--ap-primary); color: #fff; font-weight: 700; }
.ap-day.disabled { color: #d1d5db; cursor: not-allowed; }

/* Slots */
.ap-date-label { color: var(--ap-gray); font-size: .875rem; margin-bottom: 12px; text-transform: capitalize; }

.ap-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.ap-slot {
    padding: 13px 6px;
    border: 2px solid var(--ap-border);
    border-radius: 10px;
    background: #fff;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
    color: #111827;
}
.ap-slot:hover {
    border-color: var(--ap-primary);
    color: var(--ap-primary);
    background: #eff6ff;
}

.ap-no-slots { color: var(--ap-gray); text-align: center; padding: 24px 0; line-height: 1.6; }

/* Resumo */
.ap-summary-box {
    background: var(--ap-light);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}
.ap-sum-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: .9rem;
    border-bottom: 1px solid var(--ap-border);
}
.ap-sum-row:last-child { border: none; }
.ap-sum-row span { color: var(--ap-gray); }

/* Formulário */
.ap-form { display: flex; flex-direction: column; gap: 14px; }

.ap-field { display: flex; flex-direction: column; gap: 5px; }
.ap-field label {
    font-size: .875rem;
    font-weight: 600;
    color: #374151;
}
.ap-field input,
.ap-field textarea {
    padding: 12px 14px;
    border: 1.5px solid var(--ap-border);
    border-radius: 10px;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
    color: #111827;
}
.ap-field input:focus,
.ap-field textarea:focus {
    outline: none;
    border-color: var(--ap-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.ap-contact-hint { font-size: .78rem; color: var(--ap-gray); margin: -6px 0; }

/* Botões */
.ap-btn-primary {
    background: var(--ap-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: background .15s, opacity .15s;
    margin-top: 4px;
}
.ap-btn-primary:hover    { background: #1d4ed8; }
.ap-btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.ap-btn-secondary {
    background: var(--ap-light);
    color: #374151;
    border: 1px solid var(--ap-border);
    border-radius: 10px;
    padding: 12px 24px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.ap-btn-secondary:hover { background: var(--ap-border); }

/* Erro */
.ap-error {
    color: var(--ap-danger);
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: .875rem;
}

/* Sucesso */
.ap-success-wrap {
    text-align: center;
    padding: 32px 12px;
}
.ap-success-icon { font-size: 3.5rem; margin-bottom: 12px; }
.ap-success-wrap h2 { font-size: 1.4rem; margin-bottom: 10px; }
.ap-success-wrap p  { color: var(--ap-gray); margin-bottom: 12px; }

.ap-reference-box {
    background: var(--ap-light);
    border: 1px solid var(--ap-border);
    border-radius: 10px;
    padding: 16px;
    font-size: 1.1rem;
    letter-spacing: .5px;
    margin: 16px auto;
    max-width: 280px;
}
.ap-confirm-note {
    font-size: .82rem;
    color: var(--ap-gray);
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Progresso */
.ap-progress-wrap {
    height: 4px;
    background: var(--ap-border);
    border-radius: 2px;
    margin-top: 28px;
    overflow: hidden;
}
.ap-progress-bar {
    height: 100%;
    background: var(--ap-primary);
    border-radius: 2px;
    transition: width .35s ease;
}

/* Loading */
.ap-loading { color: var(--ap-gray); text-align: center; padding: 24px; }

/* Touch — alvos maiores em mobile */
@media (max-width: 400px) {
    .ap-slot { padding: 14px 4px; font-size: .9rem; }
    .ap-day  { font-size: .82rem; }
}
