/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
}

.header h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: #ffffff;
}

.header p {
    color: #bfdbfe;
    font-size: 1rem;
}

/* ===== SECTIONS ===== */
.section {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.section-title {
    font-size: 1.3rem;
    color: #60a5fa;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(96, 165, 250, 0.3);
}

/* ===== FORM ELEMENTS ===== */
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
    flex: 1;
    min-width: 200px;
}

.form-group.half {
    flex: 0 0 calc(50% - 8px);
    min-width: 150px;
}

label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="date"],
select {
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    width: 100%;
}

input:focus, select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

input::placeholder {
    color: #475569;
}

select {
    cursor: pointer;
}

/* ===== WITNESS BOX ===== */
.witness-box {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}

.witness-box h3 {
    color: #f59e0b;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

/* ===== BUTTONS ===== */
.actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.btn-secondary {
    background: rgba(71, 85, 105, 0.6);
    color: #e2e8f0;
    border: 1px solid rgba(71, 85, 105, 0.8);
}

.btn-secondary:hover {
    background: rgba(71, 85, 105, 0.9);
    transform: translateY(-2px);
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: #ffffff;
    color: #1a1a1a;
    max-width: 800px;
    margin: 40px auto;
    border-radius: 12px;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #dc2626;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

/* ===== LOADING ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
}

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

/* ===== CONTRACT PREVIEW STYLES ===== */
#contractPreview {
    font-family: 'Times New Roman', Times, serif;
    font-size: 14px;
    line-height: 1.8;
    color: #1a1a1a;
    padding: 40px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

#contractPreview h2 {
    text-align: center;
    font-size: 16px;
    margin-bottom: 30px;
    color: #1a1a1a;
}

#contractPreview .clause-title {
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 14px;
}

#contractPreview .signature-area {
    margin-top: 60px;
    page-break-inside: avoid;
}

#contractPreview .signature-line {
    border-top: 1px solid #000;
    width: 280px;
    margin-top: 80px;
    padding-top: 5px;
    text-align: center;
    font-size: 12px;
}

#contractPreview .signatures {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 40px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .form-group.half {
        flex: 0 0 100%;
    }
    .actions {
        flex-direction: column;
    }
    .btn {
        width: 100%;
    }
    .modal-content {
        margin: 10px auto;
        padding: 20px;
    }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    min-height: 100vh;
    padding: 20px;
}
.container { max-width: 850px; margin: 0 auto; padding: 20px; }
.header { text-align: center; margin-bottom: 30px; padding: 30px 20px; background: linear-gradient(135deg, #1e40af, #3b82f6); border-radius: 16px; box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3); }
.header h1 { font-size: 1.8rem; margin-bottom: 8px; color: #ffffff; }
.header p { color: #bfdbfe; font-size: 1rem; }
.section { background: rgba(30, 41, 59, 0.8); border: 1px solid rgba(71, 85, 105, 0.5); border-radius: 12px; padding: 24px; margin-bottom: 20px; backdrop-filter: blur(10px); }
.section-title { font-size: 1.3rem; color: #60a5fa; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid rgba(96, 165, 250, 0.3); }
.help-text { font-size: 0.9rem; color: #94a3b8; margin-bottom: 15px; line-height: 1.5; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; margin-bottom: 16px; flex: 1; min-width: 200px; }
.form-group.half { flex: 0 0 calc(50% - 8px); min-width: 150px; }
label { font-size: 0.875rem; font-weight: 600; color: #94a3b8; margin-bottom: 6px; }
input, select { padding: 12px 14px; background: rgba(15, 23, 42, 0.8); border: 1px solid rgba(71, 85, 105, 0.5); border-radius: 8px; color: #e2e8f0; font-size: 0.95rem; transition: all 0.3s ease; width: 100%; }
input:focus, select:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
input::placeholder { color: #475569; }
select { cursor: pointer; }
.witness-box { background: rgba(15, 23, 42, 0.5); border: 1px solid rgba(71, 85, 105, 0.3); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.witness-box h3 { color: #f59e0b; margin-bottom: 16px; font-size: 1.1rem; }
.actions { display: flex; gap: 16px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.btn { padding: 14px 32px; border: none; border-radius: 10px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 0.5px; }
.btn-primary { background: linear-gradient(135deg, #2563eb, #3b82f6); color: white; box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4); }
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8, #2563eb); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5); }
.btn-secondary { background: rgba(71, 85, 105, 0.6); color: #e2e8f0; border: 1px solid rgba(71, 85, 105, 0.8); }
.btn-secondary:hover { background: rgba(71, 85, 105, 0.9); transform: translateY(-2px); }
.btn-remover-sistema { background: #dc2626; color: white; border: none; border-radius: 6px; padding: 8px 12px; cursor: pointer; margin-top: 8px; align-self: flex-end; font-size: 0.85rem; }
.btn-remover-sistema:hover { background: #b91c1c; }
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); z-index: 1000; overflow-y: auto; padding: 20px; }
.modal-content { background: #ffffff; color: #1a1a1a; max-width: 800px; margin: 40px auto; border-radius: 12px; padding: 30px; position: relative; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.modal-close { position: absolute; top: 15px; right: 20px; font-size: 28px; cursor: pointer; color: #666; transition: color 0.3s; }
.modal-close:hover { color: #dc2626; }
.modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 2000; color: white; }
.spinner { width: 60px; height: 60px; border: 5px solid rgba(255, 255, 255, 0.2); border-top-color: #3b82f6; border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }
#contract-preview { font-family: 'Times New Roman', Times, serif; font-size: 14px; line-height: 1.8; color: #1a1a1a; padding: 40px; background: #fff; border: 1px solid #ddd; border-radius: 8px; }
#contract-preview h2 { text-align: center; font-size: 16px; margin-bottom: 30px; color: #1a1a1a; }
#contract-preview .clause-title { font-weight: bold; margin-top: 20px; margin-bottom: 10px; font-size: 14px; }
#contract-preview .signature-area { margin-top: 60px; page-break-inside: avoid; }
#contract-preview .signature-line { border-top: 1px solid #000; width: 280px; margin-top: 80px; padding-top: 5px; text-align: center; font-size: 12px; }
#contract-preview .signatures { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 30px; margin-top: 40px; }
@media (max-width: 600px) {
    .form-group.half { flex: 0 0 100%; }
    .actions { flex-direction: column; }
    .btn { width: 100%; }
    .modal-content { margin: 10px auto; padding: 20px; }
}

.footer {
  background-color: transparent; /* deixa o fundo livre */
  padding: 2rem 0;
  margin-top: auto;
  width: 100%;
}

.footer-card {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 12px; /* arredondado */
  padding: 1rem 1.5rem;
  text-align: center;
  color: #495057;
  font-size: 0.9rem;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.footer-card a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.footer-card a:hover {
  text-decoration: underline;
}