/* ================================================
   Meu Agendador — Public CSS (Premium)
================================================ */
*, *::before, *::after { box-sizing: border-box; }

#ma-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 900px;
    margin: 0 auto;
    color: #1e2a3a;
}

/* ── Aviso público centralizado ── */
.ma-aviso {
    background: linear-gradient(135deg, #fff8e1, #fffbf0);
    border: 1px solid #fde68a;
    border-radius: 14px;
    padding: 16px 22px;
    margin-bottom: 28px;
    font-size: 14px;
    color: #92400e;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
}
.ma-aviso::before {
    content: '📢';
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Seletor de espaço ── */
.ma-espacos-label {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #94a3b8;
    margin-bottom: 14px;
}
.ma-espacos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}
.ma-espaco-btn {
    position: relative;
    padding: 20px 16px 18px;
    border: 2px solid #e5eaf0;
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    transition: all .2s;
    text-align: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.ma-espaco-btn:hover {
    border-color: #1a3a5c;
    background: #f8faff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26,58,92,.12);
}
.ma-espaco-btn.active {
    border-color: #1a3a5c;
    background: linear-gradient(135deg, #0f2744, #1a3a5c);
    color: #fff;
    box-shadow: 0 8px 24px rgba(26,58,92,.3);
    transform: translateY(-2px);
}
.ma-espaco-emoji {
    font-size: 28px;
    line-height: 1;
}
.ma-espaco-name {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}
.ma-espaco-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(255,255,255,.2);
    color: rgba(255,255,255,.9);
    display: none;
}
.ma-espaco-btn.active .ma-espaco-badge { display: block; }
.ma-espaco-btn:not(.active) .ma-espaco-badge {
    display: block;
    background: #f1f5f9;
    color: #64748b;
}

/* ── Legenda ── */
.ma-legenda {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.ma-leg {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}
.ma-leg-dot {
    width: 12px; height: 12px;
    border-radius: 3px;
}
.ma-leg-dot.disponivel   { background: #22c55e; }
.ma-leg-dot.pendente     { background: #f59e0b; }
.ma-leg-dot.indisponivel { background: #ef4444; }

/* ── Calendário ── */
.ma-cal-wrap {
    background: #fff;
    border: 1px solid #e5eaf0;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.ma-cal-header {
    background: linear-gradient(135deg, #0f2744, #1a3a5c);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}
.ma-cal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    opacity: .9;
}
#ma-calendario .flatpickr-calendar {
    width: 100% !important;
    max-width: 100%;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 12px;
}
#ma-calendario .flatpickr-months { padding: 0 8px; }
#ma-calendario .flatpickr-month  { height: 38px; }
#ma-calendario .flatpickr-current-month { font-size: 15px; font-weight: 700; color: #1e2a3a; }
#ma-calendario .flatpickr-weekdays { background: transparent; }
#ma-calendario .flatpickr-weekday  { font-weight: 700; font-size: 11px; color: #94a3b8; text-transform: uppercase; }
#ma-calendario .flatpickr-day {
    border-radius: 8px !important;
    font-size: 13px;
    height: 36px;
    line-height: 36px;
    font-weight: 500;
    margin: 2px;
    transition: all .15s;
}

/* Calendar color states */
.flatpickr-day.ma-disponivel {
    background: #dcfce7 !important;
    color: #15803d !important;
    font-weight: 700 !important;
}
.flatpickr-day.ma-disponivel:hover {
    background: #16a34a !important;
    color: #fff !important;
}
.flatpickr-day.ma-pendente {
    background: #fef9c3 !important;
    color: #92400e !important;
    font-weight: 700 !important;
}
.flatpickr-day.ma-indisponivel,
.flatpickr-day.ma-bloqueado {
    background: #fee2e2 !important;
    color: #991b1b !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    font-weight: 700 !important;
    text-decoration: line-through;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #1a3a5c !important;
    border-color: #1a3a5c !important;
    color: #fff !important;
    font-weight: 700 !important;
}
.flatpickr-day.inRange {
    background: #dbeafe !important;
    color: #1e40af !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* ── Formulário ── */
.ma-form-container {
    background: #fff;
    border: 1px solid #e5eaf0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.ma-form-header {
    background: linear-gradient(135deg, #0f2744, #1a3a5c);
    padding: 20px 28px;
}
.ma-form-header h3 {
    margin: 0 0 3px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}
.ma-form-header p {
    margin: 0;
    font-size: 12px;
    color: rgba(255,255,255,.6);
}
.ma-form-body { padding: 24px 28px; }

.ma-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}
.ma-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.ma-field label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .6px;
}
.ma-field input[type="text"],
.ma-field input[type="email"],
.ma-field input[type="tel"],
.ma-field input[type="time"],
.ma-field textarea {
    padding: 11px 14px;
    border: 1.5px solid #e5eaf0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #1e2a3a;
    background: #fafbfc;
    transition: border-color .15s, box-shadow .15s;
}
.ma-field input:focus,
.ma-field textarea:focus {
    outline: none;
    border-color: #1a3a5c;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,58,92,.08);
}
.ma-field input[readonly] {
    background: #f1f5f9;
    color: #475569;
    cursor: default;
}

/* ── Select de horário estilizado ── */
.ma-select-wrap {
    position: relative;
}
.ma-select-wrap select {
    width: 100%;
    padding: 11px 36px 11px 14px;
    border: 1.5px solid #e5eaf0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #1e2a3a;
    background: #fafbfc;
    appearance: none;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.ma-select-wrap select:focus {
    outline: none;
    border-color: #1a3a5c;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,58,92,.08);
}
.ma-select-wrap::after {
    content: '▾';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 12px;
    pointer-events: none;
}

/* ── Data display chips ── */
.ma-datas-selecionadas {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #0369a1;
    font-weight: 600;
}
.ma-datas-selecionadas.vazio {
    background: #f8fafc;
    border-color: #e5eaf0;
    color: #94a3b8;
    font-weight: 400;
}

/* ── Divisor de seção ── */
.ma-section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
}
.ma-section-divider span {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .8px;
    white-space: nowrap;
}
.ma-section-divider::before,
.ma-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5eaf0;
}

/* ── Submit ── */
.ma-btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #0f2744, #1a3a5c);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    margin-top: 4px;
    letter-spacing: .3px;
    position: relative;
    overflow: hidden;
}
.ma-btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background .2s;
}
.ma-btn-submit:hover::before { background: rgba(255,255,255,.08); }
.ma-btn-submit:active { transform: scale(.99); }
.ma-btn-submit:disabled { background: #94a3b8; cursor: not-allowed; }

/* ── Mensagens ── */
#ma-msg {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
#ma-msg.sucesso {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
#ma-msg.erro {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}

/* ── Spinner ── */
.ma-loading {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ma-spin .65s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes ma-spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 640px) {
    .ma-espacos { grid-template-columns: 1fr; gap: 10px; }
    .ma-row { grid-template-columns: 1fr; }
    .ma-form-body { padding: 18px; }
    .ma-legenda { gap: 12px; }
}
/* ── Stepper de quantidade de pessoas ── */
.ma-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid #e5eaf0;
    border-radius: 10px;
    overflow: hidden;
    background: #fafbfc;
    transition: border-color .15s, box-shadow .15s;
    height: 44px;
}
.ma-stepper:focus-within {
    border-color: #1a3a5c;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,58,92,.08);
}
.ma-stepper-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: #1a3a5c;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    border-radius: 0;
}
.ma-stepper-btn:hover:not(:disabled) {
    background: #1a3a5c;
    color: #fff;
}
.ma-stepper-btn:disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}
.ma-stepper-btn[data-dir="down"] {
    border-right: 1.5px solid #e5eaf0;
}
.ma-stepper-btn[data-dir="up"] {
    border-left: 1.5px solid #e5eaf0;
}
.ma-stepper input[type="number"] {
    flex: 1;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #1e2a3a;
    padding: 0;
    height: 44px;
    -moz-appearance: textfield;
    outline: none;
    font-family: inherit;
}
.ma-stepper input[type="number"]::-webkit-inner-spin-button,
.ma-stepper input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ── Hint abaixo de campos ── */
.ma-field-hint {
    font-size: 11px;
    color: #94a3b8;
    margin: 4px 0 0;
    line-height: 1.4;
}