/* === DSF - Declarație Sursa Fonduri === */

.dsf-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
}

.dsf-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a2540;
    margin: 0 0 8px;
    text-align: center;
}

.dsf-lead {
    color: #666;
    text-align: center;
    margin: 0 0 30px;
    font-size: 15px;
}

.dsf-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 24px;
    margin: 0 0 20px;
    background: #fff;
}

.dsf-fieldset legend {
    padding: 4px 12px;
    background: #7fa500;
    color: #fff;
    font-weight: 700;
    border-radius: 6px;
    font-size: 14px;
    margin-left: 8px;
}

.dsf-subhead {
    font-size: 14px;
    font-weight: 700;
    color: #444;
    margin: 15px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.dsf-help {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px;
    font-style: italic;
}

.dsf-row {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}
.dsf-row-2 { grid-template-columns: 1fr 1fr; }
.dsf-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.dsf-row-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) {
    .dsf-row-2, .dsf-row-3, .dsf-row-4 { grid-template-columns: 1fr; }
}

.dsf-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
}
.dsf-field input[type="text"],
.dsf-field input[type="email"],
.dsf-field input[type="tel"],
.dsf-field input[type="number"],
.dsf-field input[type="date"],
.dsf-field input[type="file"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
    color: #1a2540;
}
.dsf-field input:focus {
    outline: none;
    border-color: #7fa500;
    box-shadow: 0 0 0 2px rgba(127, 165, 0, 0.2);
}
.dsf-field small {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
    display: block;
}

.req { color: #dc2626; font-weight: 700; }
.opt { color: #888; font-style: italic; font-weight: 400; }

/* Checkboxes */
.dsf-checks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dsf-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    transition: background 0.15s;
}
.dsf-check:hover { background: #f8faf3; }
.dsf-check input[type="checkbox"] { margin-top: 3px; }
.dsf-check span { flex: 1; font-size: 14px; }

/* Conditional fields */
.dsf-conditional {
    margin: 4px 0 8px 26px;
    padding: 12px;
    background: #f9fafb;
    border-left: 3px solid #7fa500;
    border-radius: 4px;
}

/* Declarații */
.dsf-declaratii, .dsf-gdpr {
    background: #fefce8;
    border-color: #fde68a;
}
.dsf-decl {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    margin: 8px 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}
.dsf-decl input[type="checkbox"] { margin-top: 4px; flex-shrink: 0; }
.dsf-decl span { flex: 1; font-size: 13px; line-height: 1.5; color: #444; }
.dsf-decl a { color: #7fa500; text-decoration: underline; }

/* Actions */
.dsf-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
}
.dsf-btn {
    padding: 12px 28px;
    border: 0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
}
.dsf-btn-primary {
    background: #7fa500;
    color: #fff;
}
.dsf-btn-primary:hover {
    background: #6b8a00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(127, 165, 0, 0.3);
}
.dsf-btn-secondary {
    background: #f3f4f6;
    color: #444;
    border: 1px solid #d1d5db;
}
.dsf-btn-secondary:hover { background: #e5e7eb; }

/* Preview */
.dsf-preview {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}
.dsf-preview-block {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}
.dsf-preview-block:last-child { border: 0; margin-bottom: 0; }
.dsf-preview-block h3 {
    font-size: 14px;
    color: #7fa500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px;
}
.dsf-preview-block p { margin: 3px 0; font-size: 14px; }

/* Signature */
.dsf-signature-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
}
.dsf-signature-label {
    display: block;
    font-weight: 700;
    color: #1a2540;
    margin-bottom: 10px;
}
.dsf-canvas-wrap {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background: #fafafa;
    display: flex;
    justify-content: center;
    padding: 8px;
    margin-bottom: 12px;
}
#dsf-signature-pad {
    max-width: 100%;
    background: #fff;
    cursor: crosshair;
    touch-action: none;
}
.dsf-signature-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Success */
.dsf-success {
    text-align: center;
    padding: 40px 20px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
}
.dsf-success-icon {
    width: 64px;
    height: 64px;
    background: #22c55e;
    color: #fff;
    border-radius: 50%;
    font-size: 34px;
    line-height: 64px;
    margin: 0 auto 15px;
    font-weight: 900;
}
.dsf-success h2 {
    color: #14532d;
    margin: 0 0 10px;
}
.dsf-success p { color: #166534; margin: 8px 0; }
.dsf-success .dsf-btn { margin-top: 15px; }

/* Loading */
.dsf-loading {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.dsf-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #7fa500;
    border-radius: 50%;
    animation: dsf-spin 0.8s linear infinite;
    margin-bottom: 12px;
}
@keyframes dsf-spin { to { transform: rotate(360deg); } }

/* Admin table */
.dsf-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.dsf-status-draft { background: #fef3c7; color: #92400e; }
.dsf-status-signed { background: #dbeafe; color: #1e40af; }
.dsf-status-completed { background: #d1fae5; color: #065f46; }
