/* Valori default pentru variabilele de culoare - suprascrise inline din PHP */
:root {
    --culoare: #0F408A;
    --culoare-accent: #c8a84b;
    --culoare-sectiuni: #0F408A;
    --culoare-buton: #0F408A;
    --culoare-text: #1c2333;
}

#bf177-wrap {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}
/* Formular D177 - OVP-Digital */
#bf177-wrap .bf177-wrap { max-width: 900px; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 15px; color: var(--culoare-text, #1c2333); }

/* Hero header - identic cu formularul 230 */
#bf177-wrap .bf177-hero {
    background: linear-gradient(135deg, var(--culoare, #0F408A) 0%, var(--culoare, #1a56b0) 60%, var(--culoare, #0d3470) 100%);
    color: #fff; padding: 44px 24px 36px; text-align: center;
    position: relative; overflow: hidden; border-radius: 10px 10px 0 0;
}
#bf177-wrap .bf177-hero-inner { position: relative; max-width: 640px; margin: 0 auto; }
#bf177-wrap .bf177-badge {
    display: inline-block; background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3); color: #d4e4ff;
    font-size: 11px; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; padding: 5px 14px; border-radius: 20px; margin-bottom: 14px;
}
#bf177-wrap .bf177-hero h2 {
    font-size: clamp(1.4rem,4vw,2rem) !important; font-weight: 700 !important;
    line-height: 1.25 !important; margin: 0 0 12px !important;
    color: #fff !important; padding: 0 !important; border: none !important;
}
#bf177-wrap .bf177-hero h2 span { color: var(--culoare-accent, #c8a84b); }
#bf177-wrap .bf177-hero p { font-size: .97rem; color: rgba(255,255,255,.82); line-height: 1.6; margin: 0; }
#bf177-wrap .bf177-hero-info { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
#bf177-wrap .bf177-info-item {
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
    border-radius: 8px; padding: 7px 14px; font-size: .82rem; color: rgba(255,255,255,.9);
}

/* Sectiuni */
#bf177-wrap .bf177-section { background: #fff; border: 1px solid #d0daea; border-top: none; padding: 22px 24px; }
#bf177-wrap .bf177-section:last-of-type { border-radius: 0 0 8px 8px; }
#bf177-wrap .bf177-section h3 { font-size: 14px; font-weight: 700; color: var(--culoare-sectiuni, #0F408A); margin: 0 0 16px; padding: 6px 0 6px 12px; border-left: 4px solid var(--culoare-sectiuni, #0F408A); background: rgba(0,0,0,0.04); border-radius: 0 4px 4px 0; }
#bf177-wrap .bf177-section h4 { font-size: 13px; font-weight: 700; color: #333; margin: 16px 0 10px; padding-bottom: 6px; border-bottom: 1px solid #e0e8f5; }
#bf177-wrap .bf177-optional { font-weight: 400; font-size: 12px; color: #888; }
#bf177-wrap .bf177-perioada { border-top: none; border-radius: 0; }

/* Rows */
#bf177-wrap .bf177-row { margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
#bf177-wrap .bf177-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#bf177-wrap .bf177-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
#bf177-wrap .bf177-row-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 0.6fr; gap: 12px; }
#bf177-wrap .bf177-row-5 { display: grid; grid-template-columns: 0.6fr 0.6fr 0.6fr 0.6fr 0.8fr; gap: 12px; }

/* Fields */
#bf177-wrap .bf177-field { display: flex; flex-direction: column; gap: 5px; }
#bf177-wrap .bf177-field label { font-size: 12px; font-weight: 600; color: #5a6476; text-transform: uppercase; letter-spacing: 0.3px; }
#bf177-wrap .bf177-field input, .bf177-field select, .bf177-field textarea {
    border: 1.5px solid #c8d5e8; border-radius: 5px; padding: 8px 10px;
    font-size: 14px; color: #1c2333; background: #fff; transition: border-color 0.2s;
    width: 100%; box-sizing: border-box;
}
#bf177-wrap .bf177-field input:focus, .bf177-field select:focus { outline: none; border-color: #0F408A; box-shadow: 0 0 0 3px rgba(15,64,138,0.08); }
#bf177-wrap .bf177-field input[readonly] { background: #f5f7fa; color: #888; }
#bf177-wrap .bf177-field-wide { grid-column: span 2; }
#bf177-wrap .bf177-field-sm input { max-width: 120px; }
#bf177-wrap .bf177-field-xs input { max-width: 70px; }

/* Checkboxes */
#bf177-wrap .bf177-check-label { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: #1c2333; cursor: pointer; line-height: 1.5; }
#bf177-wrap .bf177-check-label input[type=checkbox], .bf177-check-label input[type=radio] { width: 18px; height: 18px; min-width: 18px; margin-top: 2px; accent-color: #0F408A; cursor: pointer; }
#bf177-wrap .bf177-check-required { background: #f8f9ff; padding: 10px 14px; border-radius: 6px; border: 1px solid #d0daea; }
#bf177-wrap .bf177-tip-beneficiar { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

/* Semnatura */
#bf177-wrap .bf177-sectiune-semn { background: #f8fbff; }
#bf177-wrap .bf177-semn-info { display: flex; gap: 16px; background: #fff; border: 2px solid var(--culoare, #0F408A); border-radius: 8px; padding: 18px; margin-bottom: 18px; }
#bf177-wrap .bf177-semn-icon { font-size: 36px; min-width: 46px; text-align: center; }
#bf177-wrap .bf177-semn-text { font-size: 14px; line-height: 1.6; color: #1c2333; }

/* Beneficiar */
#bf177-wrap .bf177-beneficiar-wrap { background: #f8fbff; border: 1px solid #d0daea; border-radius: 6px; padding: 18px; margin-top: 16px; }

/* Submit */
#bf177-wrap .bf177-submit-row { padding: 20px 24px; background: #f5f7fa; border: 1px solid #d0daea; border-top: none; border-radius: 0 0 8px 8px; text-align: center; }
#bf177-wrap .bf177-btn-primary { background: var(--culoare-buton, var(--culoare, #0F408A)); color: #fff; border: none; border-radius: 6px; padding: 14px 40px; font-size: 16px; font-weight: 700; cursor: pointer; transition: background 0.2s; }
#bf177-wrap .bf177-btn-primary:hover { background: var(--culoare-buton, var(--culoare, #0F408A)); opacity: 0.88; }
#bf177-wrap .bf177-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* Mesaje */
#bf177-wrap .bf177-msg { padding: 14px 18px; border-radius: 6px; margin: 16px 24px; font-size: 14px; }
#bf177-wrap .bf177-msg.success { background: #eafaf1; border: 1px solid #27ae60; color: #1a7a42; }
#bf177-wrap .bf177-msg.error   { background: #fdf0f0; border: 1px solid #e74c3c; color: #c0392b; }

/* Responsive */
@media (max-width: 680px) {
    #bf177-wrap .bf177-row-2, .bf177-row-3, .bf177-row-4, .bf177-row-5 { grid-template-columns: 1fr; }
    #bf177-wrap .bf177-field-wide { grid-column: span 1; }
    #bf177-wrap .bf177-header { flex-direction: column; text-align: center; }
    #bf177-wrap .bf177-semn-info { flex-direction: column; }
}

/* Sectiunea depunere */
#bf177-wrap .bf177-depunere-info { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
#bf177-wrap .bf177-depunere-item { display: flex; gap: 16px; align-items: flex-start; background: #f8fbff; border: 1px solid #d0daea; border-radius: 8px; padding: 14px 18px; }
#bf177-wrap .bf177-dep-nr { background: #0F408A; color: #fff; width: 34px; height: 34px; min-width: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
#bf177-wrap .bf177-dep-text { font-size: 14px; line-height: 1.6; }
#bf177-wrap .bf177-dep-text strong { display: block; margin-bottom: 3px; color: #1c2333; }
#bf177-wrap .bf177-dep-text span { color: #5a6476; }
#bf177-wrap .bf177-dep-text a { color: #0F408A; }
#bf177-wrap .bf177-atentie-box { background: #fff8e7; border: 1px solid #ffc107; border-left: 4px solid #ffc107; border-radius: 4px; padding: 12px 16px; font-size: 14px; line-height: 1.6; margin-bottom: 6px; }

/* Hint sub camp */
#bf177-wrap .bf177-field-hint { font-size: 11.5px; color: #0F408A; margin-top: 3px; font-style: italic; }



/* ══════════════════════════════════════════════
   RESPONSIVE - Formular 177
══════════════════════════════════════════════ */

/* Desktop mare (>1400px) */
@media (min-width: 1400px) {
    .bf177-wrap { max-width: 1100px; }
}

/* Desktop normal (1024px - 1399px) */
@media (max-width: 1399px) and (min-width: 1024px) {
    .bf177-wrap { max-width: 900px; }
}

/* Laptop / Tablet landscape (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    .bf177-wrap { max-width: 95%; }
    #bf177-wrap .bf177-row-3  { grid-template-columns: 1fr 1fr; }
    #bf177-wrap .bf177-row-4  { grid-template-columns: 1fr 1fr; }
    #bf177-wrap .bf177-row-5  { grid-template-columns: 1fr 1fr 1fr; }
    #bf177-wrap .bf177-hero   { padding: 36px 20px 28px; }
    #bf177-wrap .bf177-hero h2 { font-size: 1.6rem !important; }
    #bf177-wrap .bf177-section { padding: 16px 16px 14px; }
    #bf177-wrap .bf177-depunere-item { padding: 12px 14px; }
}

/* Tablet portrait (600px - 767px) */
@media (max-width: 767px) and (min-width: 600px) {
    .bf177-wrap { max-width: 98%; }
    #bf177-wrap .bf177-row-2,
    #bf177-wrap .bf177-row-3  { grid-template-columns: 1fr 1fr; }
    #bf177-wrap .bf177-row-4,
    #bf177-wrap .bf177-row-5  { grid-template-columns: 1fr 1fr; }
    #bf177-wrap .bf177-hero   { padding: 30px 18px 24px; border-radius: 8px 8px 0 0; }
    #bf177-wrap .bf177-hero h2 { font-size: 1.4rem !important; }
    #bf177-wrap .bf177-hero p  { font-size: .9rem; }
    #bf177-wrap .bf177-section { padding: 14px 14px 12px; margin-bottom: 12px; }
    #bf177-wrap .bf177-info-item { padding: 6px 10px; font-size: .78rem; }
    #bf177-wrap .bf177-btn-primary { width: 100%; }
    #bf177-wrap .bf177-semn-info { flex-direction: column; }
    #bf177-wrap .bf177-depunere-item { padding: 10px 12px; }
}

/* Mobile (< 600px) */
@media (max-width: 599px) {
    .bf177-wrap { max-width: 100%; }
    #bf177-wrap .bf177-row-2,
    #bf177-wrap .bf177-row-3,
    #bf177-wrap .bf177-row-4,
    #bf177-wrap .bf177-row-5  { grid-template-columns: 1fr; }
    #bf177-wrap .bf177-hero   { padding: 24px 16px 20px; border-radius: 6px 6px 0 0; }
    #bf177-wrap .bf177-hero h2 { font-size: 1.25rem !important; }
    #bf177-wrap .bf177-hero p  { font-size: .85rem; }
    #bf177-wrap .bf177-badge   { font-size: 10px; padding: 4px 10px; }
    #bf177-wrap .bf177-hero-info { gap: 8px; }
    #bf177-wrap .bf177-info-item { padding: 5px 10px; font-size: .76rem; }
    #bf177-wrap .bf177-section { padding: 12px 12px 10px; margin-bottom: 10px; border-radius: 6px; }
    #bf177-wrap .bf177-section h3 { font-size: 13px !important; }
    #bf177-wrap .bf177-atentie-box { font-size: .85rem; padding: 10px 12px; }
    #bf177-wrap .bf177-depunere-info { gap: 10px; }
    #bf177-wrap .bf177-depunere-item { flex-direction: column; padding: 12px; }
    #bf177-wrap .bf177-dep-nr { width: 28px; height: 28px; font-size: 14px; }
    #bf177-wrap .bf177-semn-info { flex-direction: column; padding: 14px; }
    #bf177-wrap .bf177-semn-icon { font-size: 28px; }
    #bf177-wrap .bf177-beneficiar-wrap { padding: 14px 12px; }
    #bf177-wrap .bf177-btn-primary { width: 100%; padding: 12px 20px; font-size: .95rem; }
    #bf177-wrap .bf177-check-label { font-size: .85rem; }
    #bf177-wrap .bf177-field input,
    #bf177-wrap .bf177-field select { font-size: 16px; } /* previne zoom pe iOS */
    #bf177-wrap .bf177-tip-beneficiar { gap: 6px; }
}

/* ── Beneficiari dinamici ── */
#bf177-wrap .bf177-benef-section { position: relative; border: 2px solid var(--border, #c8d5e8); }
#bf177-wrap .bf177-benef-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
#bf177-wrap .bf177-benef-header h3 { margin: 0 !important; }
#bf177-wrap .bf177-btn-sterge {
    background: #fff0f0; border: 1.5px solid #e74c3c; color: #e74c3c;
    border-radius: 6px; padding: 6px 14px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all .2s;
}
#bf177-wrap .bf177-btn-sterge:hover { background: #e74c3c; color: #fff; }
#bf177-wrap .bf177-add-benef-wrap { text-align: center; margin: 8px 0 16px; }
#bf177-wrap .bf177-btn-add {
    background: #fff; border: 2px dashed var(--culoare-sectiuni, #0F408A);
    color: var(--culoare-sectiuni, #0F408A); border-radius: 8px;
    padding: 12px 32px; font-size: 15px; font-weight: 700; cursor: pointer;
    transition: all .2s; width: 100%;
}
#bf177-wrap .bf177-btn-add:hover { background: var(--culoare-sectiuni, #0F408A); color: #fff; }
#bf177-wrap .bf177-tip-benef-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
#bf177-wrap .bf177-subh {
    font-size: 13px !important; font-weight: 700 !important; color: #5a6476 !important;
    margin: 14px 0 10px !important; padding: 0 0 5px !important;
    border-bottom: 1px solid #e0e8f5 !important; border-left: none !important;
    background: none !important;
}
#bf177-wrap .bf177-infobox {
    background: rgba(0,0,0,0.04); border-left: 4px solid var(--culoare, #0F408A);
    border-radius: 6px; padding: 12px 16px; margin-bottom: 16px;
    font-size: 14px; line-height: 1.6; border-top: 1px solid #d0daea;
    border-right: 1px solid #d0daea; border-bottom: 1px solid #d0daea;
}
#bf177-wrap .bf177-dl-btn {
    display: inline-block; background: #1a7a42; color: #fff !important;
    padding: 10px 24px; border-radius: 6px; font-weight: 700; text-decoration: none;
    font-size: 15px; margin-top: 4px;
}
#bf177-wrap .bf177-dl-btn:hover { background: #145c32; }
#bf177-wrap .bf177-field-full { grid-column: span 2; }

/* ── Stiluri noi formular D177 redesigned ── */
#bf177-wrap .bf177-infobox {
    background: rgba(0,0,0,0.04); border-left: 4px solid var(--culoare, #0F408A);
    border-radius: 6px; padding: 12px 16px; margin-bottom: 16px;
    font-size: 14px; line-height: 1.6;
}
#bf177-wrap .bf177-infobox a { color: var(--culoare, #0F408A); }

#bf177-wrap .bf177-subsection-title {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: #5a6476; margin: 16px 0 8px;
    padding-bottom: 6px; border-bottom: 1px solid #e0e8f5;
}

/* Beneficiar block */
#bf177-wrap .bf177-beneficiar-block { margin-bottom: 0; }
#bf177-wrap .bf177-beneficiar-header {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--culoare, #0F408A); color: #fff;
    padding: 10px 20px; border-radius: 8px 8px 0 0; margin-top: 16px;
}
#bf177-wrap .bf177-beneficiar-nr { font-weight: 700; font-size: 14px; }
#bf177-wrap .bf177-btn-delete-bnf {
    background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
    color: #fff; border-radius: 5px; padding: 4px 12px; font-size: 12px;
    cursor: pointer; transition: background .2s;
}
#bf177-wrap .bf177-btn-delete-bnf:hover { background: rgba(220,50,50,.6); }
#bf177-wrap .bf177-section-bnf { border-radius: 0 0 8px 8px; border-top: none; margin-bottom: 0; }

/* Buton adauga beneficiar */
#bf177-wrap .bf177-add-bnf-row { padding: 16px 0; }
#bf177-wrap .bf177-btn-add {
    background: #fff; border: 2px dashed var(--culoare, #0F408A);
    color: var(--culoare, #0F408A); border-radius: 8px; padding: 12px 24px;
    font-size: 15px; font-weight: 700; cursor: pointer; width: 100%;
    transition: all .2s;
}
#bf177-wrap .bf177-btn-add:hover {
    background: var(--culoare, #0F408A); color: #fff;
}

/* Sectiune declaratie */
#bf177-wrap .bf177-sectiune-decl { background: #f8fbff; }

/* Mesaje */
#bf177-wrap .bf177-msg { padding: 14px 18px; border-radius: 6px; margin: 12px 0; font-size: 14px; line-height: 1.6; }
#bf177-wrap .bf177-msg.success { background: #eafaf1; border: 1px solid #27ae60; color: #1a7a42; }
#bf177-wrap .bf177-msg.error   { background: #fdf0f0; border: 1px solid #e74c3c; color: #c0392b; }

/* Submit */
#bf177-wrap .bf177-submit-row { padding: 20px 0; text-align: center; }
#bf177-wrap .bf177-btn-primary {
    background: var(--culoare-buton, var(--culoare, #0F408A)); color: #fff;
    border: none; border-radius: 8px; padding: 14px 40px;
    font-size: 16px; font-weight: 700; cursor: pointer; transition: filter .2s; width: 100%;
}
#bf177-wrap .bf177-btn-primary:hover { filter: brightness(.88); }
#bf177-wrap .bf177-btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* ── Pasi dupa generare ── */
#bf177-wrap .bf177-steps-wrap { display: flex; flex-direction: column; gap: 14px; }
#bf177-wrap .bf177-step {
    display: flex; gap: 16px; align-items: flex-start;
    background: #f8fbff; border: 1px solid #d0daea;
    border-radius: 8px; padding: 16px 18px;
}
#bf177-wrap .bf177-step-nr {
    background: var(--culoare, #0F408A); color: #fff;
    width: 36px; height: 36px; min-width: 36px;
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-weight: 700; font-size: 16px;
}
#bf177-wrap .bf177-step-body { display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.6; }
#bf177-wrap .bf177-step-body strong { display: block; color: #1c2333; font-size: 15px; }
#bf177-wrap .bf177-step-body span { color: #5a6476; }
#bf177-wrap .bf177-step-body a { color: var(--culoare, #0F408A); font-weight: 600; }

#bf177-wrap .bf177-semn-optiuni { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
#bf177-wrap .bf177-semn-opt {
    background: #fff; border: 1px solid #d0daea; border-radius: 6px;
    padding: 12px 14px; font-size: 13px; color: #5a6476; line-height: 1.6;
}
#bf177-wrap .bf177-semn-opt strong { display: block; color: #1c2333; margin-bottom: 4px; }
#bf177-wrap .bf177-semn-opt a { color: var(--culoare, #0F408A); }

@media (max-width: 599px) {
    #bf177-wrap .bf177-semn-optiuni { grid-template-columns: 1fr; }
    #bf177-wrap .bf177-step { flex-direction: row; }
}

/* Dashicons in formular */
.bf177-info-item .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 2px;
    color: rgba(255,255,255,0.9);
}
.bf177-section h3 .dashicons,
.bf177-step-title .dashicons,
.bf177-infobox .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    vertical-align: middle;
    margin-right: 4px;
}
.bf177-btn-delete-bnf .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: middle;
}
