/* ipAppointment — frontend booking form
   Scoped under .ipa-wrap so it blends into most themes without bleeding out. */

.ipa-wrap {
    --ipa-accent: #2563eb;
    --ipa-accent-dark: #1d4ed8;
    --ipa-ink: #1f2430;
    --ipa-muted: #6b7280;
    --ipa-line: #e2e6ee;
    --ipa-bg: #ffffff;
    --ipa-radius: 14px;
    max-width: 640px;
    margin: 0 auto;
    color: var(--ipa-ink);
    font-size: 16px;
    line-height: 1.5;
}

.ipa-form {
    background: var(--ipa-bg);
    border: 1px solid var(--ipa-line);
    border-radius: var(--ipa-radius);
    padding: clamp(20px, 4vw, 36px);
    box-shadow: 0 10px 30px -18px rgba(20, 30, 60, .35);
}

.ipa-intro {
    margin: 0 0 22px;
    color: var(--ipa-muted);
}

.ipa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ipa-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.ipa-field--full {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.ipa-grid .ipa-field {
    margin-bottom: 0;
}

.ipa-label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
}

.ipa-label abbr {
    color: var(--ipa-accent);
    text-decoration: none;
    border: 0;
}

.ipa-form input[type="text"],
.ipa-form input[type="tel"],
.ipa-form input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 16px;
    color: var(--ipa-ink);
    background: #fbfcfe;
    border: 1px solid var(--ipa-line);
    border-radius: 10px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.ipa-form input:focus {
    outline: none;
    border-color: var(--ipa-accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

/* Schedule heading */
.ipa-field--full .ipa-label {
    margin-top: 22px;
    display: inline-block;
}

.ipa-slots-empty {
    color: var(--ipa-muted);
    font-size: 14px;
    margin: 6px 0;
}

.ipa-inline-error {
    color: #991b1b;
    font-size: 14px;
    font-weight: 600;
    margin: 6px 0;
}

/* The schedule: one row per available date. */
.ipa-schedule {
    margin-top: 8px;
    border: 1px solid var(--ipa-line);
    border-radius: var(--ipa-radius);
    overflow: hidden;
    max-height: 420px;
    overflow-y: auto;
}

.ipa-day {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 14px;
    padding: 14px 16px;
    border-top: 1px solid var(--ipa-line);
    align-items: start;
}

.ipa-day:first-child {
    border-top: 0;
}

.ipa-day-label {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    padding-top: 6px;
}

.ipa-day-weekday {
    font-weight: 700;
    font-size: 15px;
}

.ipa-day-date {
    font-size: 13px;
    color: var(--ipa-muted);
}

.ipa-day-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ipa-slot {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 8px 14px;
    border: 1px solid var(--ipa-line);
    border-radius: 9px;
    background: #fbfcfe;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .05s;
    user-select: none;
}

.ipa-slot:hover {
    border-color: var(--ipa-accent);
}

.ipa-slot:active {
    transform: translateY(1px);
}

.ipa-slot input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.ipa-slot:has(input:checked) {
    border-color: var(--ipa-accent);
    background: rgba(37, 99, 235, .1);
    box-shadow: 0 0 0 1px var(--ipa-accent) inset;
}

.ipa-slot:has(input:focus-visible) {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .2);
}

.ipa-slot-time {
    font-weight: 600;
    font-size: 15px;
}

.ipa-submit {
    margin-top: 26px;
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: var(--ipa-accent);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s, transform .05s;
}

.ipa-submit:hover {
    background: var(--ipa-accent-dark);
}

.ipa-submit:active {
    transform: translateY(1px);
}

.ipa-submit[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

/* Notices */
.ipa-notice {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.ipa-notice--success {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #abefc6;
}

.ipa-notice--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.ipa-again a {
    color: var(--ipa-accent);
    font-weight: 600;
}

/* Honeypot — visually + assistively hidden */
.ipa-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (max-width: 520px) {
    .ipa-grid {
        grid-template-columns: 1fr;
    }

    .ipa-day {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .ipa-day-label {
        flex-direction: row;
        gap: 6px;
        align-items: baseline;
        padding-top: 0;
    }
}
