/* ============================================================
   PL Forms – Public Styles (responsive & mobile-friendly)
   ============================================================ */

.pl-form-wrapper {
    max-width: 640px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1e293b;
}

.pl-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Individual field */
.pl-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.pl-label,
.pl-form-field legend.pl-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #0f172a;
    margin: 0;
    padding: 0;
}

.pl-required {
    color: #dc2626;
    font-weight: 700;
}

/* Inputs, textarea, select */
.pl-form-field input[type="text"],
.pl-form-field input[type="email"],
.pl-form-field input[type="tel"],
.pl-form-field input[type="number"],
.pl-form-field textarea,
.pl-form-field select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    font-size: 1rem;
    line-height: 1.4;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.pl-form-field input:focus,
.pl-form-field textarea:focus,
.pl-form-field select:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.pl-form-field textarea {
    min-height: 120px;
    resize: vertical;
}

/* Select arrow */
.pl-form-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Radio & Checkbox groups */
.pl-radio-group,
.pl-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.pl-radio-label,
.pl-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-weight: 400;
    cursor: pointer;
    line-height: 1.4;
}

.pl-radio-label input,
.pl-checkbox-label input {
    margin-top: 0.2rem;
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    accent-color: #0284c7;
}

/* reCAPTCHA */
.pl-recaptcha-field {
    margin-top: 0.25rem;
}

.pl-recaptcha-field .g-recaptcha {
    transform-origin: left top;
}

/* Submit button */
.pl-submit-field {
    margin-top: 0.5rem;
}

.pl-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 160px;
    padding: 0.85rem 1.75rem;
    background: #0284c7;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.pl-submit-btn:hover {
    background: #0369a1;
}

.pl-submit-btn:active {
    transform: scale(0.98);
}

.pl-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Messages */
.pl-form-messages {
    margin-top: 0.5rem;
}

.pl-form-message {
    padding: 0.9rem 1.1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.45;
}

.pl-form-message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.pl-form-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Field-level error */
.pl-field-error {
    font-size: 0.85rem;
    color: #dc2626;
    margin-top: 0.2rem;
}

.pl-form-field.has-error input,
.pl-form-field.has-error textarea,
.pl-form-field.has-error select {
    border-color: #dc2626;
}

.pl-form-field.has-error input:focus,
.pl-form-field.has-error textarea:focus,
.pl-form-field.has-error select:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

/* Error state for the whole form (rare) */
.pl-form-error {
    color: #dc2626;
    padding: 1rem;
    background: #fef2f2;
    border-radius: 8px;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .pl-form-wrapper {
        font-size: 15px;
    }

    .pl-form-field input[type="text"],
    .pl-form-field input[type="email"],
    .pl-form-field input[type="tel"],
    .pl-form-field input[type="number"],
    .pl-form-field textarea,
    .pl-form-field select {
        padding: 0.7rem 0.9rem;
    }

    .pl-submit-btn {
        width: 100%;
        min-width: 0;
    }

    /* Scale reCAPTCHA on very small screens */
    .pl-recaptcha-field .g-recaptcha {
        transform: scale(0.92);
        transform-origin: left top;
    }
}

@media (max-width: 360px) {
    .pl-recaptcha-field .g-recaptcha {
        transform: scale(0.85);
    }
}
