/* ── SaaS Reservations – Frontend Styles ─────────────────────────────────── */

/* CSS custom properties – primary colour overridden per-instance via inline style */
.saas-res-wrapper {
    --saas-primary:      #2563eb;
    --saas-primary-dark: color-mix(in srgb, var(--saas-primary) 80%, black);
    --saas-primary-bg:   color-mix(in srgb, var(--saas-primary) 8%, white);
    --saas-radius:       12px;
    --saas-border:       #e2e8f0;
    --saas-text:         #1e293b;
    --saas-muted:        #64748b;
    --saas-error-bg:     #fef2f2;
    --saas-error-border: #fecaca;
    --saas-error-text:   #dc2626;
    --saas-success-bg:   #f0fdf4;
    --saas-success-text: #15803d;
    --saas-shadow:       0 4px 24px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: var(--saas-text);
    max-width: 680px;
    margin: 2rem auto;
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.saas-res-card-outer {
    background: #fff;
    border-radius: var(--saas-radius);
    box-shadow: var(--saas-shadow);
    overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.saas-res-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 28px 32px 0;
}
.saas-res-header-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}
.saas-res-title {
    margin: 0 !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--saas-text) !important;
    line-height: 1.2 !important;
    border: none !important;
    padding: 0 !important;
}

/* ── Form layout ─────────────────────────────────────────────────────────────── */
.saas-res-form {
    padding: 24px 32px 32px;
}
.saas-res-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 540px) {
    .saas-res-form { padding: 20px; }
    .saas-res-header { padding: 20px 20px 0; }
    .saas-res-row { grid-template-columns: 1fr; }
}

/* ── Fields ─────────────────────────────────────────────────────────────────── */
.saas-res-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.saas-res-field-full {
    margin-bottom: 16px;
}
.saas-res-field label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--saas-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.saas-required {
    color: var(--saas-primary);
    margin-left: 2px;
}
.saas-res-field input,
.saas-res-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--saas-border);
    border-radius: 8px;
    font-size: .9375rem;
    color: var(--saas-text);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    line-height: 1.5;
    appearance: none;
    -webkit-appearance: none;
}
.saas-res-field input:focus,
.saas-res-field textarea:focus {
    outline: none;
    border-color: var(--saas-primary);
    box-shadow: 0 0 0 3px var(--saas-primary-bg);
}
.saas-res-field input.saas-invalid,
.saas-res-field textarea.saas-invalid {
    border-color: var(--saas-error-text);
}
.saas-res-field textarea {
    resize: vertical;
    min-height: 80px;
}
/* Number input - remove arrows on Firefox */
.saas-res-field input[type="number"] {
    -moz-appearance: textfield;
}
.saas-res-field input[type="number"]::-webkit-inner-spin-button,
.saas-res-field input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* ── Party size stepper ──────────────────────────────────────────────────────── */
.saas-res-party-control {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--saas-border);
    border-radius: 8px;
    overflow: hidden;
}
.saas-res-party-btn {
    width: 40px;
    height: 42px;
    border: none;
    background: #f8fafc;
    color: var(--saas-text);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.saas-res-party-btn:hover {
    background: var(--saas-primary-bg);
    color: var(--saas-primary);
}
.saas-res-party-control input[type="number"] {
    flex: 1;
    border: none;
    border-left: 1.5px solid var(--saas-border);
    border-right: 1.5px solid var(--saas-border);
    border-radius: 0;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    padding: 10px 4px;
    min-width: 0;
}
.saas-res-party-control input[type="number"]:focus {
    box-shadow: none;
    outline: none;
    border-color: var(--saas-border);
}

/* ── Honeypot ─────────────────────────────────────────────────────────────────── */
.saas-res-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    visibility: hidden;
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

/* ── Error area ──────────────────────────────────────────────────────────────── */
.saas-res-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: var(--saas-error-bg);
    border: 1px solid var(--saas-error-border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 20px;
    font-size: .9rem;
    color: var(--saas-error-text);
    font-weight: 500;
}
.saas-res-error-icon { flex-shrink: 0; }

/* ── Submit row ──────────────────────────────────────────────────────────────── */
.saas-res-submit-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}
.saas-res-privacy {
    margin: 0;
    font-size: .78rem;
    color: var(--saas-muted);
    line-height: 1.4;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.saas-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: .9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, box-shadow .2s, transform .1s;
    text-decoration: none;
    white-space: nowrap;
}
.saas-btn-primary {
    background: var(--saas-primary);
    color: #fff;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--saas-primary) 40%, transparent);
}
.saas-btn-primary:hover {
    background: var(--saas-primary-dark);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--saas-primary) 35%, transparent);
    transform: translateY(-1px);
}
.saas-btn-primary:active { transform: translateY(0); }
.saas-btn-primary:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}
.saas-btn-outline {
    background: #fff;
    color: var(--saas-primary);
    border: 1.5px solid var(--saas-primary);
    padding: 10px 22px;
}
.saas-btn-outline:hover {
    background: var(--saas-primary-bg);
}

/* ── Spinner ─────────────────────────────────────────────────────────────────── */
.saas-res-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: saas-spin .65s linear infinite;
}
.saas-res-submit.is-loading .saas-res-spinner { display: block; }

@keyframes saas-spin {
    to { transform: rotate(360deg); }
}

/* ── Success panel ───────────────────────────────────────────────────────────── */
.saas-res-success {
    padding: 40px 32px;
    text-align: center;
    background: var(--saas-success-bg);
}
.saas-res-success-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 12px;
}
.saas-res-success h3 {
    margin: 0 0 8px !important;
    font-size: 1.25rem !important;
    color: var(--saas-success-text) !important;
    font-weight: 700 !important;
    border: none !important;
}
.saas-res-success-msg {
    color: var(--saas-muted);
    margin-bottom: 20px;
}

/* ── reCAPTCHA notice ────────────────────────────────────────────────────────── */
.saas-res-recaptcha-notice {
    font-size: .72rem;
    color: var(--saas-muted);
    text-align: center;
    margin-top: 10px;
    margin-bottom: 0;
    line-height: 1.5;
}
.saas-res-recaptcha-notice a {
    color: var(--saas-muted);
    text-decoration: underline;
}

/* ── reCAPTCHA badge (optional: hide and put notice instead) ─────────────────── */
.grecaptcha-badge {
    visibility: hidden !important;
}

/* ── Time slot select ────────────────────────────────────────────────────── */
.saas-res-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--saas-border);
    border-radius: 8px;
    font-size: .9375rem;
    color: var(--saas-text);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}
.saas-res-select:focus {
    outline: none;
    border-color: var(--saas-primary);
    box-shadow: 0 0 0 3px var(--saas-primary-bg);
}
.saas-res-select.saas-invalid { border-color: var(--saas-error-text); }

.saas-res-slot-hint {
    font-size: .8rem;
    color: var(--saas-muted);
    margin-top: 4px;
}
