/* Pediatric Patient Intake Form CSS */
.ppf-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 30px;
    background: #ffffff;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    color: #2c3e50;
    line-height: 1.5;
}

/* Progress Step Bar */
.ppf-step-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 12px;
}

.ppf-step-item {
    flex: 1;
    text-align: center;
    font-weight: 600;
    color: #95a5a6;
    padding: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.ppf-step-item.active {
    color: #0073aa;
    border-bottom: 3px solid #0073aa;
}

.ppf-step-item.completed {
    color: #27ae60;
}

/* Form Headers */
.ppf-header-title {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #1a252f;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.ppf-header-subtitle {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 20px;
}

.ppf-section-title {
    font-size: 16px;
    font-weight: bold;
    border-bottom: 2px solid #2c3e50;
    padding-bottom: 4px;
    margin: 25px 0 15px 0;
    text-transform: uppercase;
}

.ppf-notice {
    background: #f8f9fa;
    padding: 10px 15px;
    border-left: 4px solid #0073aa;
    font-size: 14px;
    margin-bottom: 20px;
    color: #495057;
}

/* Form Layout Grid */
.ppf-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 14px;
}

.ppf-col-12 { flex: 0 0 100%; width: 100%; }
.ppf-col-6  { flex: 0 0 calc(50% - 7.5px); width: calc(50% - 7.5px); }
.ppf-col-4  { flex: 0 0 calc(33.333% - 10px); width: calc(33.333% - 10px); }
.ppf-col-3  { flex: 0 0 calc(25% - 11.25px); width: calc(25% - 11.25px); }

@media (max-width: 768px) {
    .ppf-col-6, .ppf-col-4, .ppf-col-3 {
        flex: 0 0 100%;
        width: 100%;
    }
}

/* Underline Styled Inputs */
.ppf-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.ppf-group label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.ppf-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color 0.2s, background-color 0.2s;
}

.ppf-input:focus {
    border-color: #0073aa;
    outline: none;
    background: #ffffff;
}

textarea.ppf-input {
    resize: vertical;
    min-height: 70px;
}

/* Red Validation Error Messages */
.ppf-field-error {
    color: #e74c3c;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    display: block;
    animation: ppfFadeIn 0.2s ease-in-out;
}

.ppf-input.ppf-invalid, select.ppf-invalid, textarea.ppf-invalid {
    border: 1px solid #e74c3c !important;
    background-color: #fff5f5 !important;
}

.ppf-signature-canvas-container.ppf-invalid {
    border: 2px dashed #e74c3c !important;
    background-color: #fff5f5 !important;
}

@keyframes ppfFadeIn {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Medical History Checklist Table */
.ppf-checklist-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 25px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .ppf-checklist-grid {
        grid-template-columns: 1fr;
    }
}

.ppf-checklist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f9fbfd;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.ppf-checklist-label {
    font-size: 13px;
    color: #334155;
    font-weight: 500;
    padding-right: 10px;
}

/* YES / NO Toggle with Tick Marks */
.ppf-yesno-toggle {
    display: inline-flex;
    background: #e2e8f0;
    border-radius: 4px;
    padding: 2px;
    gap: 2px;
    min-width: 100px;
}

.ppf-yesno-toggle label {
    flex: 1;
    text-align: center;
    padding: 4px 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 3px;
    user-select: none;
    color: #64748b;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ppf-yesno-toggle input[type="radio"] {
    display: none;
}

.ppf-yesno-toggle input[type="radio"]:checked + span {
    background: #27ae60;
    color: #ffffff;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    width: 100%;
}

.ppf-yesno-toggle input[value="no"]:checked + span {
    background: #4a5568;
}

.ppf-yesno-toggle span {
    display: block;
    padding: 3px 6px;
}

.ppf-yesno-toggle input[type="radio"]:checked + span::before {
    content: "✓ ";
    font-weight: bold;
    margin-right: 3px;
}

/* Legal Consent Text Box with Checkbox */
.ppf-consent-box {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    padding: 16px;
    font-size: 13px;
    color: #4a3b32;
    margin: 20px 0;
    line-height: 1.6;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.ppf-consent-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    cursor: pointer;
    margin-top: 2px;
    accent-color: #27ae60;
}

.ppf-consent-text {
    flex: 1;
    text-align: justify;
}

/* Signature Canvas Styling */
.ppf-signature-wrapper {
    margin-top: 15px;
    margin-bottom: 20px;
    position: relative;
}

.ppf-signature-canvas-container {
    border: 2px dashed #0073aa;
    border-radius: 6px;
    background: #ffffff;
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 160px;
    touch-action: none;
    cursor: crosshair;
}

.ppf-signature-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.ppf-signature-controls {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ppf-btn-clear {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.ppf-btn-clear:hover {
    background: #c0392b;
}

.ppf-sig-hint {
    font-size: 12px;
    color: #7f8c8d;
}

/* Navigation Buttons */
.ppf-button-group {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.ppf-btn {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ppf-btn-prev {
    background: #95a5a6;
    color: #ffffff;
}

.ppf-btn-prev:hover {
    background: #7f8c8d;
}

.ppf-btn-next, .ppf-btn-submit {
    background: #0073aa;
    color: #ffffff;
}

.ppf-btn-next:hover, .ppf-btn-submit:hover {
    background: #005177;
}

.ppf-btn-submit {
    background: #27ae60;
}

.ppf-btn-submit:hover {
    background: #219150;
}

/* Messages & Alerts */
.ppf-alert {
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    font-size: 14px;
    display: none;
}

.ppf-alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ppf-alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading Overlay */
.ppf-loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: ppf-spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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