/* =========================================================
   RT Formulário Trabalhista — Frontend CSS
   ========================================================= */

#rt-app { font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; color:#111827; line-height:1.5; }
#rt-app *{box-sizing:border-box;}

/* HEADER */
.rt-header{background:linear-gradient(135deg,#1e40af 0%,#1d4ed8 100%);color:#fff;position:sticky;top:0;z-index:100;box-shadow:0 2px 8px rgba(0,0,0,.2);}
.rt-header-inner{max-width:1100px;margin:0 auto;padding:12px 20px;display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;}
.rt-header-title{font-size:1rem;font-weight:700;}
.rt-header-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.rt-save-indicator{font-size:.75rem;color:rgba(255,255,255,.75);min-width:80px;}
.rt-load-select{padding:6px 10px;border-radius:7px;border:1.5px solid rgba(255,255,255,.4);background:rgba(255,255,255,.1);color:#fff;font-size:.82rem;cursor:pointer;}
.rt-load-select option{color:#111;}

/* BUTTONS */
.rt-btn{padding:7px 16px;border-radius:8px;border:none;cursor:pointer;font-size:.82rem;font-weight:600;transition:all .15s;display:inline-flex;align-items:center;gap:6px;}
.rt-btn:hover{transform:translateY(-1px);box-shadow:0 4px 8px rgba(0,0,0,.15);}
.rt-btn-white{background:#fff;color:#1e40af;}
.rt-btn-outline{background:transparent;color:#fff;border:1.5px solid rgba(255,255,255,.5);}
.rt-btn-outline:hover{background:rgba(255,255,255,.1);}
.rt-btn-green{background:#16a34a;color:#fff;}
.rt-btn-primary-big{background:#7c3aed;color:#fff;padding:11px 22px;font-size:.9rem;}
.rt-btn-outline-dark{background:transparent;color:#374151;border:1.5px solid #d1d5db;}

/* NAV */
.rt-nav{background:#fff;border-bottom:1px solid #e5e7eb;overflow-x:auto;white-space:nowrap;position:sticky;top:53px;z-index:90;}
.rt-nav::-webkit-scrollbar{display:none;}
.rt-nav-inner{max-width:1100px;margin:0 auto;padding:0 20px;display:flex;gap:2px;}
.rt-nav-btn{padding:9px 14px;border:none;background:none;cursor:pointer;font-size:.78rem;font-weight:500;color:#6b7280;border-bottom:2.5px solid transparent;transition:all .15s;white-space:nowrap;}
.rt-nav-btn:hover{color:#1e40af;}
.rt-nav-btn.active{color:#1e40af;border-bottom-color:#1e40af;font-weight:700;}

/* MAIN */
.rt-main{max-width:1100px;margin:0 auto;padding:22px 20px 90px;}

/* SECTIONS */
.rt-section{background:#fff;border-radius:10px;box-shadow:0 1px 3px rgba(0,0,0,.1);margin-bottom:18px;overflow:hidden;border:1px solid #e5e7eb;display:none;}
.rt-section.active{display:block;}
.rt-section-header{padding:14px 22px;display:flex;align-items:center;gap:12px;border-bottom:1px solid #f3f4f6;}
.rt-section-icon{font-size:1.3rem;}
.rt-section-title{font-size:1rem;font-weight:700;}
.rt-section-subtitle{font-size:.78rem;color:#6b7280;margin-top:1px;}
.rt-section-body{padding:22px;}

.rt-hdr-blue .rt-section-header{background:linear-gradient(90deg,#eff6ff,#fff);border-left:4px solid #1e40af;}
.rt-hdr-teal .rt-section-header{background:linear-gradient(90deg,#f0fdfa,#fff);border-left:4px solid #0f766e;}
.rt-hdr-purple .rt-section-header{background:linear-gradient(90deg,#faf5ff,#fff);border-left:4px solid #7c3aed;}
.rt-hdr-amber .rt-section-header{background:linear-gradient(90deg,#fffbeb,#fff);border-left:4px solid #d97706;}
.rt-hdr-red .rt-section-header{background:linear-gradient(90deg,#fef2f2,#fff);border-left:4px solid #dc2626;}
.rt-hdr-green .rt-section-header{background:linear-gradient(90deg,#f0fdf4,#fff);border-left:4px solid #16a34a;}

/* GRID */
.rt-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
.rt-cols-1{grid-template-columns:1fr;}
.rt-col-2{grid-column:span 2;}
.rt-two-col{display:grid;grid-template-columns:1fr 1fr;gap:22px;}

/* FIELDS */
.rt-field{display:flex;flex-direction:column;gap:4px;}
.rt-field label{font-size:.75rem;font-weight:600;color:#374151;text-transform:uppercase;letter-spacing:.03em;}
.rt-req{color:#dc2626;margin-left:2px;}
.rt-field input,.rt-field select,.rt-field textarea{padding:8px 11px;border:1.5px solid #e5e7eb;border-radius:7px;font-size:.88rem;color:#111827;background:#f9fafb;transition:border-color .15s,box-shadow .15s;font-family:inherit;width:100%;}
.rt-field input:focus,.rt-field select:focus,.rt-field textarea:focus{outline:none;border-color:#1e40af;box-shadow:0 0 0 3px rgba(30,64,175,.08);background:#fff;}
.rt-field textarea{resize:vertical;min-height:90px;}
.rt-tall{min-height:150px!important;}

/* RADIO */
.rt-radio-group{display:flex;flex-wrap:wrap;gap:7px;}
.rt-radio-opt{display:flex;align-items:center;gap:5px;padding:5px 11px;border:1.5px solid #e5e7eb;border-radius:20px;cursor:pointer;font-size:.82rem;transition:all .15s;user-select:none;background:#f9fafb;}
.rt-radio-opt:hover{border-color:#1e40af;background:#dbeafe;}
.rt-radio-opt input[type="radio"]{display:none;}
.rt-radio-opt.selected{border-color:#1e40af;background:#dbeafe;color:#1e40af;font-weight:600;}

/* CHECKBOXES */
.rt-checkbox-list{display:flex;flex-direction:column;gap:6px;}
.rt-check-item{display:flex;align-items:center;gap:9px;padding:9px 12px;border-radius:7px;border:1.5px solid #f3f4f6;cursor:pointer;transition:all .15s;user-select:none;background:#f9fafb;}
.rt-check-item:hover{border-color:#1e40af;background:#dbeafe;}
.rt-check-item.checked{border-color:#1e40af;background:#dbeafe;}
.rt-check-box{width:17px;height:17px;border:2px solid #d1d5db;border-radius:4px;flex-shrink:0;display:flex;align-items:center;justify-content:center;background:#fff;transition:all .15s;}
.rt-check-item.checked .rt-check-box{background:#1e40af;border-color:#1e40af;}
.rt-check-item.checked .rt-check-box::after{content:'✓';color:#fff;font-size:11px;font-weight:700;}
.rt-check-label{font-size:.85rem;color:#374151;line-height:1.3;}
.rt-check-item.checked .rt-check-label{color:#1e40af;font-weight:600;}

/* SUBSECTION */
.rt-subsection-title{font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#6b7280;margin-bottom:10px;padding-bottom:5px;border-bottom:1px solid #f3f4f6;}

/* STATUS BAR */
.rt-status-bar{position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:1px solid #e5e7eb;padding:9px 22px;display:flex;align-items:center;justify-content:center;gap:14px;z-index:80;box-shadow:0 -2px 8px rgba(0,0,0,.06);}
.rt-progress-wrap{display:flex;align-items:center;gap:9px;flex:1;max-width:380px;}
.rt-progress-outer{flex:1;height:6px;background:#e5e7eb;border-radius:3px;overflow:hidden;}
.rt-progress-inner{height:100%;background:#1e40af;border-radius:3px;transition:width .3s;}
.rt-progress-label{font-size:.78rem;font-weight:600;color:#6b7280;white-space:nowrap;}

/* MODAL */
.rt-modal-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:1000;align-items:center;justify-content:center;padding:18px;}
.rt-modal-overlay.open{display:flex;}
.rt-modal{background:#fff;border-radius:10px;box-shadow:0 20px 60px rgba(0,0,0,.3);width:100%;max-width:760px;max-height:88vh;display:flex;flex-direction:column;}
.rt-modal-header{padding:16px 22px;border-bottom:1px solid #e5e7eb;display:flex;align-items:center;justify-content:space-between;}
.rt-modal-title{font-size:.95rem;font-weight:700;}
.rt-modal-body{padding:18px 22px;overflow-y:auto;flex:1;}
.rt-modal-footer{padding:12px 22px;border-top:1px solid #e5e7eb;display:flex;gap:9px;justify-content:flex-end;}
.rt-output-text{width:100%;height:380px;padding:12px;border:1.5px solid #e5e7eb;border-radius:8px;font-size:.8rem;font-family:'Courier New',monospace;background:#f9fafb;resize:none;color:#374151;}
.rt-close-btn{background:none;border:none;font-size:1.3rem;cursor:pointer;color:#6b7280;padding:2px 6px;}

@media(max-width:680px){
  .rt-grid{grid-template-columns:1fr;}
  .rt-col-2{grid-column:span 1;}
  .rt-two-col{grid-template-columns:1fr;}
  .rt-header-inner{gap:8px;}
}
