/* ============================================================
   Patient Referral Manager - Public Form Styles
   ============================================================ */

.prm-form-wrapper {
    max-width: 860px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
    color: #2d3142;
}

/* Intro */
.prm-form-intro {
    margin-bottom: 32px;
}
.prm-form-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a2236;
    margin: 0 0 10px;
    border-bottom: 3px solid #005587;
    padding-bottom: 12px;
}
.prm-form-description {
    color: #555;
    margin: 0 0 12px;
    font-size: 0.97rem;
    line-height: 1.6;
}
.prm-required-note {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}
.prm-required {
    color: #c0392b;
    font-weight: 700;
}

/* Sections (fieldsets) */
.prm-section {
    border: 1px solid #dce3ec;
    border-radius: 10px;
    padding: 28px 30px 20px;
    margin-bottom: 28px;
    background: #fafcff;
    position: relative;
}
.prm-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #005587;
    padding: 0 10px;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.prm-section-icon {
    font-size: 1.1rem;
}
.prm-section-desc {
    font-size: 0.88rem;
    color: #666;
    margin: 0 0 20px;
    padding: 0;
    line-height: 1.5;
}

/* Field grid */
.prm-fields-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.prm-field-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.prm-col-full { width: 100%; }
.prm-col-half {
    width: calc(50% - 8px);
}

/* Labels */
.prm-field-wrap label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #333;
    display: block;
}

/* Inputs */
.prm-field-wrap input[type="text"],
.prm-field-wrap input[type="email"],
.prm-field-wrap input[type="tel"],
.prm-field-wrap input[type="number"],
.prm-field-wrap input[type="date"],
.prm-field-wrap input[type="url"],
.prm-field-wrap textarea,
.prm-field-wrap select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #c8d4e0;
    border-radius: 7px;
    font-size: 0.95rem;
    color: #2d3142;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}
.prm-field-wrap input:focus,
.prm-field-wrap textarea:focus,
.prm-field-wrap select:focus {
    outline: none;
    border-color: #005587;
    box-shadow: 0 0 0 3px rgba(0, 85, 135, 0.12);
}
.prm-field-wrap textarea {
    resize: vertical;
    min-height: 90px;
}
.prm-field-wrap input.prm-error,
.prm-field-wrap textarea.prm-error,
.prm-field-wrap select.prm-error {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

/* Checkbox / Radio */
.prm-checkbox-label,
.prm-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    cursor: pointer;
}
.prm-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Upload area */
.prm-section-upload {
    background: #f0f7ff;
    border-color: #b3d1ea;
}
.prm-dropzone {
    border: 2px dashed #8ab8d9;
    border-radius: 10px;
    background: #fff;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}
.prm-dropzone:hover,
.prm-dropzone.prm-drag-over {
    border-color: #005587;
    background: #edf5fc;
}
.prm-dropzone-icon .dashicons {
    font-size: 2.8rem;
    width: 2.8rem;
    height: 2.8rem;
    color: #8ab8d9;
    margin-bottom: 10px;
}
.prm-dropzone-text {
    margin: 0;
    font-size: 0.95rem;
    color: #555;
}
.prm-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.prm-file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #eaf3fb;
    border: 1px solid #b3d1ea;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
    font-size: 0.9rem;
}
.prm-file-preview .dashicons {
    color: #005587;
    font-size: 1.3rem;
}
.prm-file-name {
    flex: 1;
    font-weight: 600;
    color: #1a2236;
    word-break: break-all;
}
.prm-file-size {
    color: #777;
    font-size: 0.82rem;
}
.prm-remove-file {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #c0392b;
    line-height: 1;
    padding: 0 4px;
}
.prm-field-note {
    font-size: 0.82rem;
    color: #666;
    margin: 10px 0 0;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    line-height: 1.5;
}
.prm-field-note .dashicons {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Notices */
.prm-notice {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.92rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.prm-notice .dashicons {
    flex-shrink: 0;
    margin-top: 1px;
}
.prm-notice-success { background: #e8f8f0; border: 1px solid #a3d9b9; color: #1d6a3e; }
.prm-notice-error   { background: #fdf0ef; border: 1px solid #f5b7b1; color: #922b21; }
.prm-notice-info    { background: #eaf4fb; border: 1px solid #a9cce3; color: #1a5276; }

/* Referrer note */
.prm-referrer-note {
    margin-top: 18px;
    font-size: 0.88rem;
}

/* Submit */
.prm-submit-row {
    text-align: right;
    margin-top: 10px;
}
.prm-submit-btn {
    background: #005587;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 36px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 3px 12px rgba(0,85,135,0.25);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.prm-submit-btn:hover {
    background: #004470;
    box-shadow: 0 5px 18px rgba(0,85,135,0.35);
    transform: translateY(-1px);
}
.prm-submit-btn:active {
    transform: translateY(0);
}
.prm-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.prm-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: prm-spin 0.7s linear infinite;
}
@keyframes prm-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media ( max-width: 600px ) {
    .prm-section { padding: 20px 16px 16px; }
    .prm-col-half { width: 100%; }
    .prm-submit-btn { width: 100%; justify-content: center; }
    .prm-form-title { font-size: 1.4rem; }
}
