/* Agriturismo Prenotazioni – frontend. Colori personalizzabili tramite variabili CSS. */
.agp-booking {
    --agp-accent: #4a5d3a;
    --agp-accent-dark: #36452a;
    --agp-danger: #8a3b2e;
    --agp-bg: #ffffff;
    --agp-soft: #f4f1ea;
    --agp-border: #ddd6c8;
    --agp-text: #2d2a26;
    --agp-muted: #7a7368;
    --agp-full: #d9a441;
    max-width: 640px;
    margin: 0 auto;
    color: var(--agp-text);
    font-size: 16px;
    line-height: 1.5;
}
.agp-booking *, .agp-booking *::before, .agp-booking *::after { box-sizing: border-box; }
.agp-booking [hidden] { display: none !important; }

.agp-title { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 1.3em; }
.agp-title span {
    width: 30px; height: 30px; border-radius: 50%; background: var(--agp-accent); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: .8em; flex-shrink: 0;
}
.agp-label { display: block; font-weight: 600; margin: 18px 0 8px; font-size: .95em; }
.agp-hint { color: var(--agp-muted); font-size: .85em; margin: 6px 0 0; }

.agp-people { display: inline-flex; border: 1px solid var(--agp-border); border-radius: 8px; overflow: hidden; }
.agp-people input {
    width: 64px; text-align: center; border: 0; font-size: 1.1em; font-weight: 600; padding: 10px 0;
    -moz-appearance: textfield; background: var(--agp-bg); color: var(--agp-text);
}
.agp-people input::-webkit-outer-spin-button, .agp-people input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.agp-people-btn {
    width: 46px; border: 0; background: var(--agp-soft); font-size: 1.3em; cursor: pointer; color: var(--agp-text);
}
.agp-people-btn:hover { background: var(--agp-border); }

.agp-calendar { border: 1px solid var(--agp-border); border-radius: 10px; padding: 12px; background: var(--agp-bg); }
.agp-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.agp-cal-nav {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--agp-border); background: var(--agp-bg);
    font-size: 1.3em; cursor: pointer; line-height: 1; color: var(--agp-text);
}
.agp-cal-nav:disabled { opacity: .3; cursor: default; }
.agp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.agp-cal-wd { text-align: center; font-size: .75em; color: var(--agp-muted); text-transform: uppercase; padding: 4px 0; }
.agp-day {
    aspect-ratio: 1; border: 0; border-radius: 8px; font-size: .95em; cursor: pointer; padding: 0;
    background: transparent; color: var(--agp-text); position: relative;
}
.agp-day-open { background: #e8eedf; font-weight: 600; }
.agp-day-open:hover { background: var(--agp-accent); color: #fff; }
.agp-day-full { background: #f6ead2; color: #9a7a3a; text-decoration: line-through; cursor: not-allowed; }
.agp-day-closed { color: #c4bcae; cursor: not-allowed; background: repeating-linear-gradient(45deg, transparent 0 4px, #f1ede6 4px 8px); }
.agp-day-off { color: #c9c3b8; cursor: not-allowed; }
.agp-day-loading { color: #ccc; background: var(--agp-soft); cursor: wait; }
.agp-day.agp-sel { background: var(--agp-accent) !important; color: #fff !important; }

.agp-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8em; color: var(--agp-muted); margin-top: 8px; }
.agp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }
.agp-dot-open { background: #c7d6b5; }
.agp-dot-full { background: var(--agp-full); }
.agp-dot-closed { background: #ddd6c8; }

.agp-service { margin-bottom: 14px; }
.agp-service-label { display: block; font-size: .8em; text-transform: uppercase; letter-spacing: .05em; color: var(--agp-muted); margin-bottom: 6px; }
.agp-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.agp-time {
    padding: 10px 0; border: 1px solid var(--agp-accent); border-radius: 8px; background: var(--agp-bg);
    color: var(--agp-accent-dark); font-weight: 600; cursor: pointer; font-size: .95em;
}
.agp-time:hover, .agp-time.agp-sel { background: var(--agp-accent); color: #fff; }
.agp-time:disabled { border-color: var(--agp-border); color: #bbb; background: var(--agp-soft); text-decoration: line-through; cursor: not-allowed; }

.agp-summary { background: var(--agp-soft); padding: 12px 16px; border-radius: 8px; margin: 0 0 8px; }
.agp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.agp-grid p { margin: 0; }
@media (max-width: 520px) { .agp-grid { grid-template-columns: 1fr; } }

.agp-booking input[type=text], .agp-booking input[type=email], .agp-booking input[type=tel], .agp-booking textarea {
    width: 100%; padding: 11px 12px; border: 1px solid var(--agp-border); border-radius: 8px;
    font: inherit; background: var(--agp-bg); color: var(--agp-text);
}
.agp-booking input:focus, .agp-booking textarea:focus { outline: 2px solid var(--agp-accent); outline-offset: 1px; border-color: transparent; }
.agp-check { font-size: .9em; margin: 14px 0; }
.agp-check input { margin-right: 6px; }
.agp-ask { margin: 18px 0 4px; padding: 18px; border-radius: 14px; background: var(--agp-soft); border: 1px solid var(--agp-border); animation: agpIn .25s ease-out; }
.agp-ask p { margin: 0 0 10px; }
.agp-ask-t { font-weight: 800; font-size: 1.15em; }
.agp-ask-s { color: var(--agp-muted); font-size: .9em; }
.agp-ask-b { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.agp-ask-b .agp-btn { width: 100%; min-height: 52px; padding: 10px 12px; }
@media (max-width: 520px) { .agp-ask-b { grid-template-columns: 1fr; } }
@keyframes agpIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.agp-mkt label { display: flex; gap: 8px; align-items: flex-start; color: var(--agp-muted); line-height: 1.4; }
.agp-mkt input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0 !important; accent-color: var(--agp-accent); }
.agp-hp { position: absolute !important; left: -9999px !important; height: 0; overflow: hidden; }

.agp-actions { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-top: 18px; }
.agp-btn {
    padding: 13px 24px; border-radius: 8px; border: 0; background: var(--agp-accent); color: #fff;
    font: inherit; font-weight: 600; cursor: pointer;
}
.agp-btn:hover { background: var(--agp-accent-dark); }
.agp-btn:disabled { opacity: .6; cursor: wait; }
.agp-btn-ghost { background: transparent; color: var(--agp-accent-dark); border: 1px solid var(--agp-border); }
.agp-btn-ghost:hover { background: var(--agp-soft); }
.agp-btn-danger { background: var(--agp-danger); }
.agp-btn-danger:hover { background: #6e2e24; }

.agp-message { margin-top: 16px; padding: 12px 16px; border-radius: 8px; }
.agp-message.agp-err { background: #f8e5e1; color: #7a2e22; }
.agp-message.agp-ok { background: #e8eedf; color: var(--agp-accent-dark); }
.agp-err { color: #7a2e22; }
.agp-loading { color: var(--agp-muted); }

.agp-done { text-align: center; padding: 28px 16px; background: var(--agp-soft); border-radius: 12px; }
.agp-done-icon {
    width: 64px; height: 64px; border-radius: 50%; background: var(--agp-accent); color: #fff; font-size: 32px;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
}
.agp-done-text { font-size: 1.1em; font-weight: 600; }

.agp-cancel { background: var(--agp-soft); padding: 24px; border-radius: 12px; }
.agp-cancel h3 { margin-top: 0; }
.agp-cancel-details { list-style: none; padding: 0; margin: 16px 0 20px; background: var(--agp-bg); border-radius: 8px; }
.agp-cancel-details li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--agp-border); }
.agp-cancel-details li:last-child { border-bottom: 0; }
.agp-cancel-details span { color: var(--agp-muted); }
