/* ============================================================
   Deal Flow AI — UI estilo VC profesional (tema claro)
   ============================================================ */
:root {
    --bg:          #f7f8fa;
    --panel:       #ffffff;
    --text:        #1a1f2e;
    --text-dim:    #5a6378;
    --text-faint:  #8b93a7;
    --border:      #e3e7ee;
    --accent:      #6c4dff;
    --accent-dim:  #4a2fcf;
    --green:       #10b981;
    --amber:       #f59e0b;
    --red:         #ef4444;
    --shadow:      0 4px 24px rgba(20,30,60,0.08);
    --radius:      14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== TOPBAR ===== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #6c4dff, #8b6fff);
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 14px rgba(108,77,255,0.35);
}
.brand-name { font-weight: 700; font-size: 17px; }
.brand-sub { font-size: 12px; color: var(--text-dim); }

.status {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--text-dim);
    padding: 7px 12px;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #f0b400; }
.status-dot.ready { background: var(--green); }
.status-dot.error { background: var(--red); }

/* ===== MAIN ===== */
.main {
    flex: 1;
    max-width: 920px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

/* ===== UPLOAD ZONE ===== */
.upload-zone { display: flex; flex-direction: column; align-items: center; gap: 32px; }

.drop-area {
    width: 100%;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 56px 32px;
    text-align: center;
    background: var(--panel);
    transition: all 0.2s;
    cursor: pointer;
}
.drop-area:hover, .drop-area.dragover {
    border-color: var(--accent);
    background: rgba(108,77,255,0.04);
}
.drop-icon { font-size: 56px; margin-bottom: 16px; }
.drop-area h2 { font-size: 20px; margin-bottom: 6px; }
.drop-hint { color: var(--text-dim); font-size: 14px; margin-bottom: 18px; }
.select-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 11px 26px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.select-btn:hover { background: var(--accent-dim); transform: translateY(-1px); }

.samples { width: 100%; }
.samples-title { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; text-align: center; }
.samples-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.sample-btn {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 9px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.sample-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* ===== LOADING ===== */
.loading-zone { text-align: center; padding: 80px 20px; }
.loader { max-width: 420px; margin: 0 auto; }
.spinner {
    width: 56px; height: 56px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-zone h2 { font-size: 19px; margin-bottom: 8px; }
.loading-hint { color: var(--text-dim); font-size: 14px; margin-bottom: 6px; }
.loading-note { color: var(--text-faint); font-size: 12px; }

/* ===== RESULT ===== */
.result-zone { display: flex; flex-direction: column; gap: 24px; }

.result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.verdict-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.verdict-badge.INVESTIGAR { background: rgba(16,185,129,0.12); color: var(--green); }
.verdict-badge.DUDAR { background: rgba(245,158,11,0.12); color: var(--amber); }
.verdict-badge.PASS { background: rgba(239,68,68,0.12); color: var(--red); }

.result-header h1 { font-size: 22px; line-height: 1.3; margin-bottom: 4px; }
.project-meta { font-size: 13px; color: var(--text-dim); }

.global-score-box { text-align: center; flex-shrink: 0; }
.global-score {
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
    color: var(--accent);
}
.global-score-label { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

.resumen {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
}

.section-title { font-size: 15px; font-weight: 700; color: var(--text); }

/* ===== SCORECARD ===== */
.scorecard { display: grid; grid-template-columns: 1fr; gap: 10px; }
.dimension {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.dimension-name { flex: 1; }
.dimension-name .label { font-size: 14px; font-weight: 600; }
.dimension-name .reason { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.45; }
.dimension-score {
    font-size: 22px;
    font-weight: 700;
    width: 44px;
    text-align: center;
    flex-shrink: 0;
}
.dimension-score.high { color: var(--green); }
.dimension-score.mid { color: var(--amber); }
.dimension-score.low { color: var(--red); }

/* ===== PRO / CON ===== */
.pro-con { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pro-card, .con-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}
.pro-card { border-left: 3px solid var(--green); }
.con-card { border-left: 3px solid var(--amber); }
.pro-card h4, .con-card h4 { font-size: 14px; margin-bottom: 10px; }
.pro-card ul, .con-card ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.pro-card li, .con-card li { font-size: 13.5px; color: var(--text-dim); line-height: 1.5; }

/* ===== RED FLAGS / COMPARABLES ===== */
.red-flags, .comparables {
    background: rgba(239,68,68,0.04);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: var(--radius);
    padding: 18px;
}
.comparables {
    background: rgba(108,77,255,0.04);
    border-color: rgba(108,77,255,0.2);
}
.red-flags h4 { color: var(--red); margin-bottom: 10px; font-size: 14px; }
.comparables h4 { color: var(--accent); margin-bottom: 10px; font-size: 14px; }
.red-flags ul, .comparables ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.red-flags li, .comparables li { font-size: 13.5px; color: var(--text-dim); line-height: 1.5; }
.comparables li strong { color: var(--accent); }

/* ===== NEXT STEP ===== */
.next-step {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
}
.next-step h4 { font-size: 14px; margin-bottom: 8px; color: var(--accent); }
.next-step p { font-size: 14px; color: var(--text); line-height: 1.55; }

/* ===== COMPLIANCE ===== */
.compliance {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    font-size: 13px;
}
.compliance summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-dim);
    padding: 4px 0;
}
.compliance-content { margin-top: 14px; line-height: 1.6; color: var(--text-dim); }
.compliance-content h5 { color: var(--text); margin: 12px 0 6px; font-size: 13px; }
.compliance-content code { background: var(--bg); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.compliance-content .aviso { color: var(--amber); font-style: italic; margin-top: 10px; }

/* ===== ACTIONS ===== */
.actions { display: flex; gap: 10px; justify-content: center; }
.action-btn {
    padding: 11px 22px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.action-btn.primary { background: var(--accent); color: white; }
.action-btn.primary:hover { background: var(--accent-dim); transform: translateY(-1px); }
.action-btn.secondary { background: var(--panel); color: var(--text-dim); border: 1px solid var(--border); }
.action-btn.secondary:hover { border-color: var(--text-dim); color: var(--text); }

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 16px;
    font-size: 11.5px;
    color: var(--text-faint);
    border-top: 1px solid var(--border);
}

/* ===== OVERLAY CONSENT ===== */
.consent-overlay {
    position: fixed; inset: 0;
    background: rgba(15,20,40,0.6);
    backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
    animation: fadeIn 0.3s ease;
}
.consent-overlay.hidden { display: none; }
.consent-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    max-width: 460px; width: 100%;
    box-shadow: var(--shadow);
    text-align: center;
    animation: slideUp 0.4s ease;
}
.consent-icon { font-size: 46px; margin-bottom: 14px; }
.consent-card h2 { font-size: 19px; margin-bottom: 12px; }
.consent-body { font-size: 13.5px; color: var(--text-dim); line-height: 1.6; margin-bottom: 16px; }
.consent-body a { color: var(--accent); text-decoration: none; }
.consent-list { list-style: none; text-align: left; margin-bottom: 22px; display: flex; flex-direction: column; gap: 7px; }
.consent-list li {
    font-size: 12.5px; color: var(--text-dim);
    padding: 9px 12px; background: var(--bg);
    border-radius: 8px; line-height: 1.4;
}
.consent-list strong { color: var(--text); }
.consent-btn {
    width: 100%;
    padding: 12px;
    border-radius: 11px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    background: var(--accent); color: white; border: none;
    transition: all 0.2s;
}
.consent-btn:hover { background: var(--accent-dim); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.hidden { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    .main { padding: 20px 14px 40px; }
    .pro-con { grid-template-columns: 1fr; }
    .result-header { flex-direction: column; }
    .global-score-box { align-self: flex-end; }
    .topbar { padding: 14px 18px; }
}
