/* ============================================================
   Pickbox Form Widget
   ============================================================ */

/* Wrapper */
.pickbox-form-widget-wrap {
    width: 100%;
    box-sizing: border-box;
}

/* Form grid */
.pickbox-form-widget {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* Honeypot */
.pickbox-form-widget .pickbox-form-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* ── Field wrapper ───────────────────────────────────────── */
.pickbox-form-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

/* Column-span helpers */
.pickbox-field-full {
    grid-column: 1 / -1;
}

.pickbox-field-half {
    grid-column: span 1;
}

/* ── Label ───────────────────────────────────────────────── */
.pickbox-form-field > label {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    color: #2c2c2c;
    line-height: 1.4;
}

.pickbox-form-field > label .pb-required-star {
    color: #e74c3c;
    margin-left: 2px;
    font-weight: 700;
}

/* ── Inputs, Textarea, Select ────────────────────────────── */
.pickbox-form-field input:not([type="checkbox"]),
.pickbox-form-field textarea,
.pickbox-form-field select {
    width: 100%;
    box-sizing: border-box;
    background-color: #ffffff;
    color: #2c2c2c;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    padding: 10px 14px;
    min-height: 44px;
    font-size: 15px;
    line-height: 1.5;
    font-family: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
}

.pickbox-form-field input:not([type="checkbox"]):focus,
.pickbox-form-field textarea:focus,
.pickbox-form-field select:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.pickbox-form-field input:not([type="checkbox"])::placeholder,
.pickbox-form-field textarea::placeholder {
    color: #a0aab4;
}

/* Textarea */
.pickbox-form-field textarea {
    min-height: 130px;
    resize: vertical;
}

/* Select arrow */
.pickbox-form-field select {
    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='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%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;
}

/* ── Checkbox group ──────────────────────────────────────── */
.pickbox-form-options {
    display: grid;
    gap: 8px;
}

.pickbox-form-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #2c2c2c;
    cursor: pointer;
    line-height: 1.4;
}

.pickbox-form-options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #4a6cf7;
    cursor: pointer;
}

/* ── Submit button wrapper ───────────────────────────────── */
.pickbox-form-submit-wrap {
    grid-column: 1 / -1;
    display: flex;
}

/* ── Submit button ───────────────────────────────────────── */
.pickbox-form-widget button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #4a6cf7;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 11px 28px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.5;
    cursor: pointer;
    transition: background-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    white-space: nowrap;
}

.pickbox-form-widget button[type="submit"]:hover {
    background-color: #3558e8;
    box-shadow: 0 4px 14px rgba(74, 108, 247, 0.35);
}

.pickbox-form-widget button[type="submit"]:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Loading spinner inside button */
.pickbox-form-widget button[type="submit"] .pb-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pbSpin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes pbSpin {
    to { transform: rotate(360deg); }
}

/* ── Response message ────────────────────────────────────── */
.pickbox-form-message {
    grid-column: 1 / -1;
    font-size: 14px;
    line-height: 1.5;
    min-height: 0;
    border-radius: 6px;
    padding: 0;
    transition: padding 0.18s ease;
}

.pickbox-form-message:not(:empty) {
    padding: 10px 14px;
}

.pickbox-form-message.is-success {
    color: #14532d;
    background-color: #f0fdf4;
}

.pickbox-form-message.is-error {
    color: #7f1d1d;
    background-color: #fef2f2;
}

