/* ========================================
   Negocie v2 — Estilo do Portal Original
   ======================================== */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.5;
    color: #1e2022;
    background: #fff;
}
a { color: #1e2022; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
button { font-family: 'Inter', sans-serif; cursor: pointer; }
input { font-family: 'Inter', sans-serif; }

/* === HEADER === */
.header {
    background: #fff;
    box-shadow: 0 3px 6px 0 rgba(140,152,164,.25);
    position: relative;
    z-index: 2;
}
.header-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 8px 16px;
}
.logo { width: 160px; height: auto; display: block; }

/* === HERO SECTION === */
.hero { background-color: #E71037; }
.hero-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 64px 16px;
    position: relative;
    z-index: 2;
}
.hero-grid {
    display: flex;
    gap: 32px;
    align-items: center;
}
.hero-text { flex: 1 1 58.33%; }
.hero-text h3 {
    color: #fff;
    font-size: 2.78rem;
    font-weight: 400;
    line-height: 1.167;
    margin-bottom: 12px;
}
.hero-text p {
    color: #fff;
    font-weight: 500;
    font-size: 1.25rem;
    line-height: 1.6;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 8px;
    padding: 10px 16px;
    margin-top: 20px;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
}
.hero-badge-pct {
    background: #fff;
    color: #E71037;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
}
.hero-form { flex: 1 1 41.67%; }

/* === FORM CARD === */
.form-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 6px 0 rgba(140,152,164,.25);
    padding: 24px;
    width: 100%;
}
.form-title {
    font-size: 1rem;
    font-weight: 400;
    text-align: left;
    color: #1e2022;
    margin-bottom: 0;
}
.divider {
    border: none;
    border-bottom: 1px solid rgba(0,0,0,.12);
    margin: 16px -24px;
}

/* === FIELD === */
.field { margin-bottom: 24px; margin-top: 16px; position: relative; }
.field input {
    width: 100%;
    height: 54px;
    border: 1px solid rgba(0,0,0,.23);
    border-radius: 5px;
    padding: 16.5px 14px;
    font-size: 1rem;
    color: #1e2022;
    background: transparent;
    outline: none;
    transition: border-color .2s;
}
.field input:hover { border-color: #1e2022; }
.field input:focus { border-color: #041C2C; border-width: 2px; }
.field input.error { border-color: #d32f2f; }
.field label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #677788;
    font-size: 1rem;
    pointer-events: none;
    transition: all .2s;
    background: #fff;
    padding: 0 4px;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
    top: -2px;
    font-size: 0.75rem;
    color: #041C2C;
}
.field input.error + label { color: #d32f2f; }
.error-msg { color: #d32f2f; font-size: 0.8rem; display: none; margin-top: 4px; }

/* === BUTTONS === */
.btn-dark {
    display: block;
    width: 100%;
    height: 54px;
    background: #041C2C;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: .5px;
    box-shadow: 0 12px 15px rgba(140,152,164,.1);
    transition: background-color .25s, box-shadow .25s;
}
.btn-dark:hover {
    background: #062d44;
    box-shadow: 0 10px 40px 10px rgba(140,152,164,.175);
}
.btn-dark:disabled {
    color: rgba(0,0,0,.26);
    box-shadow: none;
    background: rgba(0,0,0,.12);
    cursor: not-allowed;
}
.btn-outline {
    display: block;
    width: 100%;
    height: 54px;
    background: transparent;
    color: #041C2C;
    border: 1px solid rgba(0,0,0,.23);
    border-radius: 5px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 12px;
    transition: background .2s, border-color .2s;
}
.btn-outline:hover {
    background: rgba(4,28,44,.04);
    border-color: #041C2C;
}

/* === SECTIONS === */
.section-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 64px 16px;
}
.section-inner h4 {
    text-align: center;
    font-weight: 700;
    font-size: 2.02rem;
    margin-bottom: 8px;
}
.section-subtitle {
    text-align: center;
    color: #677788;
    font-weight: 500;
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 48px;
}
.divider-section {
    border: none;
    border-bottom: 1px solid rgba(0,0,0,.12);
    margin: 0;
}
.partner-img {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}
.partner-img img { max-width: 250px; }

/* === STEP CARDS (How it works) === */
.steps-grid { display: flex; flex-direction: column; gap: 24px; }
.step-card {
    background: #fff;
    box-shadow: 0 3px 6px 0 rgba(140,152,164,.25);
    border-radius: 8px;
    padding: 20px;
}
.step-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
}
.avatar {
    width: 60px;
    height: 60px;
    min-width: 60px;
    background: rgba(4,28,44,.1);
    color: #041C2C;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 500;
}
.step-card h6 {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.6;
    padding: 16px 0 0 16px;
}
.step-card p {
    color: #677788;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.5;
}

/* === CLIENT CARD (Step 2) === */
.card-client { margin-bottom: 16px; }
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.status-vencer { background: rgba(25,118,210,.1); color: #1976d2; }
.status-vencido { background: rgba(211,47,47,.1); color: #d32f2f; }
.card-client h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.cpf-display, .card-display { color: #677788; font-size: 0.9rem; margin-bottom: 2px; }
.card-display { font-weight: 600; color: #1e2022; font-size: 1rem; }

/* === FATURA ROWS === */
.fatura-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}
.fatura-label { color: #677788; font-size: 0.9rem; }
.fatura-value { font-weight: 600; font-size: 1rem; }
.fatura-value.red { color: #d32f2f; }
.fatura-value.green { color: #05a677; font-size: 1.25rem; }
.fatura-row.total { padding-top: 8px; }

/* === DESCONTO === */
.desconto-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.desconto-tag {
    background: #05a677;
    color: #fff;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* === PIX SECTION === */
.qr-container {
    margin: 16px auto;
    max-width: 260px;
    text-align: center;
}
.qr-container img { border-radius: 8px; border: 1px solid rgba(0,0,0,.12); }
.pix-valor {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #041C2C;
    margin-bottom: 16px;
}
.field-label {
    display: block;
    font-weight: 500;
    font-size: 0.85rem;
    color: #1e2022;
    margin-bottom: 6px;
}
.copy-group { display: flex; gap: 8px; margin-bottom: 16px; }
.copy-group input {
    flex: 1;
    height: 48px;
    border: 1px solid rgba(0,0,0,.23);
    border-radius: 5px;
    padding: 0 14px;
    font-size: 0.8rem;
    background: #f7faff;
    color: #1e2022;
}
.alert-info {
    background: rgba(70,125,227,.08);
    border: 1px solid rgba(70,125,227,.2);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.85rem;
    color: #467de3;
    margin-bottom: 16px;
}

/* === PAYMENT WAITING === */
.payment-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: rgba(245,158,77,.08);
    border: 1px solid rgba(245,158,77,.3);
    border-radius: 8px;
    margin-bottom: 16px;
}
.payment-waiting span { font-weight: 600; color: #b45309; }
.payment-waiting small { color: #677788; font-size: 0.8rem; text-align: center; }
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(245,158,77,.3);
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === PAGO === */
.pago-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #05a677;
    color: #fff;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}
.pago-msg { color: #677788; margin-bottom: 20px; }
.pago-aviso {
    background: rgba(245,158,77,.08);
    border: 1px solid rgba(245,158,77,.3);
    border-radius: 8px;
    padding: 16px;
    font-size: 0.9rem;
    color: #b45309;
    margin-bottom: 20px;
    text-align: left;
    line-height: 1.6;
}
.pago-dados {
    background: #f7faff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}
.pago-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,.12);
    font-size: 0.9rem;
}
.pago-row:last-child { border-bottom: none; }
.pago-row span:first-child { color: #677788; }
.pago-row span:last-child { font-weight: 600; }
.pago-status { font-size: 0.85rem !important; }

/* === FOOTER === */
.footer {
    background: #f7faff;
    border-top: 1px solid rgba(0,0,0,.12);
}
.footer-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 32px 16px;
    text-align: center;
}
.footer-text {
    font-size: 0.75rem;
    line-height: 1.66;
    color: #677788;
}
.footer-text a { color: #1e2022; font-weight: 500; }

/* === STEPS VISIBILITY === */
.step { display: none; }
.step.active { display: block; }

/* === RESPONSIVE === */
@media (max-width: 899px) {
    .hero-text h3 { font-size: 2rem; }
    .hero-text p { font-size: 1.125rem; }
    .section-inner h4 { font-size: 1.82rem; }
    .step-card h6 { font-size: 1.125rem; }
}
@media (max-width: 600px) {
    .hero-grid { flex-direction: column; }
    .hero-text { margin-bottom: 32px; text-align: center; }
    .hero-text h3 { font-size: 1.75rem; }
    .section-inner { padding: 48px 16px; }
    .section-subtitle { font-size: 1rem; }
    .step-card h6 { font-size: 1rem; }
    .copy-group { flex-direction: column; }
    .pix-valor { font-size: 1.5rem; }
}

/* === ADMIN TABS === */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid rgba(0,0,0,.08);
    padding-bottom: 0;
}
.tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #677788;
    cursor: pointer;
    transition: color .2s, border-color .2s;
}
.tab:hover { color: #1e2022; }
.tab.active { color: #041C2C; border-bottom-color: #041C2C; font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === LEADS MANAGEMENT === */
.leads-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.leads-header h3 { margin: 0; }
.lead-form-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}
.lead-form-card h4 { margin-bottom: 16px; }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #677788;
    margin-bottom: 4px;
}
.form-field input,
.form-field select {
    width: 100%;
    height: 42px;
    border: 1px solid rgba(0,0,0,.23);
    border-radius: 5px;
    padding: 0 12px;
    font-size: 0.9rem;
    color: #1e2022;
}
.form-field input:focus,
.form-field select:focus {
    border-color: #041C2C;
    outline: none;
}
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}
.leads-search {
    margin-bottom: 16px;
}
.leads-search input {
    width: 100%;
    height: 42px;
    border: 1px solid rgba(0,0,0,.23);
    border-radius: 5px;
    padding: 0 14px;
    font-size: 0.9rem;
}
.leads-search input:focus { border-color: #041C2C; outline: none; }
.leads-table-wrap { overflow-x: auto; }
.leads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.leads-table th {
    text-align: left;
    padding: 10px 12px;
    background: #f7faff;
    font-weight: 600;
    color: #677788;
    border-bottom: 2px solid rgba(0,0,0,.08);
    white-space: nowrap;
}
.leads-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0,0,0,.06);
    color: #1e2022;
}
.leads-table tr:hover td { background: #f7faff; }
.leads-table .btn-del {
    background: rgba(211,47,47,.1);
    color: #d32f2f;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
}
.leads-table .btn-del:hover { background: #d32f2f; color: #fff; }
.leads-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}
.leads-pagination button {
    padding: 6px 14px;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 0.8rem;
}
.leads-pagination button.active {
    background: #041C2C;
    color: #fff;
    border-color: #041C2C;
}

/* === GATEWAYS === */
.gateways-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.gateway-card {
    background: #fff;
    border: 2px solid rgba(0,0,0,.12);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    transition: border-color .2s, box-shadow .2s;
}
.gateway-card.active {
    border-color: #05a677;
    box-shadow: 0 4px 12px rgba(5,166,119,.15);
}
.gateway-card h4 { margin-bottom: 4px; font-size: 1.1rem; }
.gateway-card .gw-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.gateway-card .gw-status.on { background: rgba(5,166,119,.1); color: #05a677; }
.gateway-card .gw-status.off { background: rgba(0,0,0,.06); color: #677788; }
.gateway-card .gw-detail { font-size: 0.8rem; color: #677788; margin-bottom: 4px; }
.gateway-card .gw-detail strong { color: #1e2022; }
.gateway-card .btn-toggle {
    margin-top: 16px;
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background .2s;
}
.gateway-card .btn-toggle.activate { background: #05a677; color: #fff; }
.gateway-card .btn-toggle.activate:hover { background: #048a5e; }
.gateway-card .btn-toggle.deactivate { background: rgba(211,47,47,.1); color: #d32f2f; }
.gateway-card .btn-toggle.deactivate:hover { background: #d32f2f; color: #fff; }
@media (max-width: 600px) {
    .gateways-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .leads-header { flex-direction: column; gap: 12px; align-items: stretch; }
}
