/* ============================================================
   POD Intelligence — App CSS
   ============================================================ */

:root {
  --brand:      #111827;
  --brand-light:#374151;
  --bg:         #f3f4f6;
  --panel:      #ffffff;
  --text:       #111827;
  --muted:      #6b7280;
  --line:       #e5e7eb;
  --radius:     16px;
  --shadow:     0 4px 24px rgba(0,0,0,.08);
  --transition: all .2s ease;
}

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

body.ifp-app-body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ifp-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ── Header ─────────────────────────────────────────── */
.ifp-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.ifp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.ifp-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}

.ifp-logo i { color: var(--brand); }

.ifp-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ifp-nav-link {
  padding: 8px 14px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: var(--transition);
}

.ifp-nav-link:hover,
.ifp-nav-link.ifp-nav-active {
  color: var(--text);
  background: var(--bg);
}

.ifp-btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text);
}

.ifp-btn-logout:hover { background: var(--bg); }

/* ── Main ────────────────────────────────────────────── */
.ifp-main {
  flex: 1;
  padding: 48px 0;
}

/* ── Card ────────────────────────────────────────────── */
.ifp-card {
  background: var(--panel);
  border-radius: 24px;
  padding: 48px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.ifp-card h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}

.ifp-subtitle {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 40px;
}

/* ── Drop zone ───────────────────────────────────────── */
.ifp-drop-zone {
  border: 2px dashed var(--line);
  border-radius: 20px;
  padding: 60px 20px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  background: #fafafa;
  margin-bottom: 32px;
  position: relative;
}

.ifp-drop-zone:hover,
.ifp-drop-zone.ifp-drag-over {
  border-color: var(--brand);
  background: #fff;
}

.ifp-drop-zone i {
  font-size: 48px;
  color: var(--brand);
  margin-bottom: 16px;
  display: block;
  opacity: .7;
}

.ifp-drop-zone h3 { font-size: 20px; margin-bottom: 8px; }
.ifp-drop-zone p  { color: var(--muted); }

.ifp-preview-img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 12px;
  display: none;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

/* ── Plataformas ─────────────────────────────────────── */
.ifp-platforms-head {
  margin: 24px 0 14px;
}

.ifp-platforms-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.ifp-platforms-note {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.ifp-platforms {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.ifp-analyze-hint {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.ifp-chip {
  padding: 20px 12px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: white;
  color: var(--muted);
  user-select: none;
}

.ifp-chip i { font-size: 22px; }

.ifp-chip:hover:not(.ifp-chip-selected) {
  border-color: #9ca3af;
  color: var(--text);
  background: #f9fafb;
}

.ifp-chip.ifp-chip-selected {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

/* ── Botón analizar ──────────────────────────────────── */
.ifp-btn-analyze {
  width: 100%;
  padding: 18px;
  font-size: 17px;
  font-weight: 800;
  border-radius: 14px;
  background: var(--brand);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: var(--transition);
  box-shadow: var(--shadow);
  font-family: inherit;
}

.ifp-btn-analyze:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
}

.ifp-btn-analyze:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ── Status box ──────────────────────────────────────── */
.ifp-status-box {
  margin-top: 24px;
  padding: 24px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  text-align: center;
}

.ifp-status-box p {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

/* ── Resultados ──────────────────────────────────────── */
.ifp-score-badge {
  font-size: 48px;
  font-weight: 900;
  color: var(--brand);
  line-height: 1;
}

.ifp-score-badge span {
  font-size: 20px;
  font-weight: 600;
  color: var(--muted);
}

.ifp-desc-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.ifp-desc-box h4,
.ifp-recs h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ifp-recs {
  margin-bottom: 24px;
}

.ifp-recs ul {
  padding-left: 20px;
}

.ifp-recs li {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 15px;
}

.ifp-platforms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.ifp-platform-result {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  background: #fafafa;
}

.ifp-platform-result h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--brand);
}

.ifp-result-row {
  margin-bottom: 12px;
}

.ifp-result-row strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.ifp-result-row p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

/* ── Footer ──────────────────────────────────────────── */
.ifp-footer {
  background: white;
  border-top: 1px solid var(--line);
  padding: 32px 0;
  color: var(--muted);
  font-size: 14px;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .ifp-container {
    padding: 0 16px;
  }

  .ifp-card {
    padding: 24px 16px;
  }

  .ifp-platforms {
    grid-template-columns: repeat(2, 1fr);
  }

  .ifp-card h1 {
    font-size: 24px;
  }

  .ifp-main {
    padding: 24px 0;
  }

  .ifp-header-inner {
    height: auto;
    min-height: 64px;
    padding: 12px 0;
    gap: 12px;
    flex-direction: column;
    align-items: flex-start;
  }

  .ifp-logo {
    font-size: 18px;
  }

  .ifp-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    align-items: center;
  }

  .ifp-nav-link {
    padding: 10px 12px;
    font-size: 13px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--line);
  }

  .ifp-btn-logout {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .ifp-container {
    padding: 0 12px;
  }

  .ifp-header-inner {
    padding: 10px 0;
  }

  .ifp-logo {
    font-size: 17px;
    gap: 8px;
  }

  .ifp-nav {
    gap: 8px;
  }

  .ifp-nav-link,
  .ifp-btn-logout {
    font-size: 12.5px;
    padding: 9px 10px;
  }

  .ifp-card {
    padding: 20px 14px;
    border-radius: 18px;
  }

  .ifp-card h1 {
    font-size: 22px;
  }

  .ifp-subtitle {
    font-size: 15px;
    margin-bottom: 28px;
  }
}


/* =====================================================
   ACCOUNT VIEW + CANCEL ACCOUNT MODAL
===================================================== */

.ifp-account-layout{
  display:grid;
  gap:24px;
}

.ifp-account-card,
.ifp-danger-card{
  position:relative;
  overflow:hidden;
}

.ifp-account-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:22px;
}

.ifp-account-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:999px;
  font-weight:700;
  font-size:14px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
}

.ifp-account-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

.ifp-account-item{
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  padding:16px 18px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.ifp-account-label{
  font-size:13px;
  opacity:.75;
}

.ifp-danger-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:18px;
}

.ifp-danger-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:999px;
  font-size:13px;
  font-weight:700;
  color:#ffd6d6;
  background:rgba(190,35,35,.18);
  border:1px solid rgba(255,90,90,.28);
}

.ifp-danger-box{
  border:1px solid rgba(255,90,90,.22);
  background:rgba(190,35,35,.08);
  border-radius:18px;
  padding:20px;
}

.ifp-danger-list{
  margin:0 0 18px 0;
  padding-left:18px;
}

.ifp-danger-list li{
  margin:0 0 10px 0;
  line-height:1.5;
}

.ifp-btn-danger{
  appearance:none;
  border:none;
  border-radius:14px;
  padding:14px 18px;
  font-weight:700;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  transition:.2s ease;
  background:#b42318;
  color:#fff;
}

.ifp-btn-danger:hover{
  transform:translateY(-1px);
  filter:brightness(1.05);
}

.ifp-btn-secondary{
  appearance:none;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.04);
  color:#fff;
  border-radius:14px;
  padding:14px 18px;
  font-weight:700;
  cursor:pointer;
  transition:.2s ease;
}

.ifp-btn-secondary:hover{
  background:rgba(255,255,255,.07);
}

.ifp-btn-danger[disabled],
.ifp-btn-secondary[disabled]{
  opacity:.55;
  cursor:not-allowed;
  transform:none;
}

.ifp-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:9999;
  background:rgba(8,12,20,.72);
  backdrop-filter:blur(6px);
  padding:20px;
  display:none;
  align-items:center;
  justify-content:center;
}

.ifp-modal-card{
  width:min(100%, 620px);
  position:relative;
  background:#111827;
  border:1px solid rgba(255,255,255,.1);
  border-radius:24px;
  padding:28px;
  box-shadow:0 30px 80px rgba(0,0,0,.45);
}

.ifp-modal-close{
  position:absolute;
  top:14px;
  right:14px;
  width:40px;
  height:40px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.1);
  background:rgba(255,255,255,.04);
  color:#fff;
  cursor:pointer;
}

.ifp-modal-icon{
  width:62px;
  height:62px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:24px;
  margin-bottom:18px;
}

.ifp-modal-icon.danger{
  background:rgba(190,35,35,.18);
  color:#ffb4b4;
  border:1px solid rgba(255,90,90,.25);
}

.ifp-modal-text{
  margin:12px 0 16px 0;
  line-height:1.6;
  opacity:.9;
}

.ifp-modal-warning{
  border:1px solid rgba(255,90,90,.2);
  background:rgba(190,35,35,.08);
  color:#ffe7e7;
  border-radius:16px;
  padding:14px 16px;
  line-height:1.5;
  margin-bottom:18px;
}

.ifp-check-row{
  display:flex;
  align-items:flex-start;
  gap:12px;
  margin-bottom:18px;
  line-height:1.5;
}

.ifp-check-row input{
  margin-top:3px;
}

.ifp-inline-feedback{
  border-radius:14px;
  padding:12px 14px;
  margin-bottom:18px;
  font-size:14px;
  line-height:1.5;
}

.ifp-inline-feedback.error{
  background:rgba(190,35,35,.12);
  border:1px solid rgba(255,90,90,.2);
  color:#ffd9d9;
}

.ifp-inline-feedback.success{
  background:rgba(28,140,92,.14);
  border:1px solid rgba(59,203,138,.22);
  color:#d8ffef;
}

.ifp-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:12px;
  flex-wrap:wrap;
}

body.ifp-modal-open{
  overflow:hidden;
}

@media (max-width: 768px){
  .ifp-account-grid{
    grid-template-columns:1fr;
  }

  .ifp-modal-card{
    padding:22px;
    border-radius:20px;
  }

  .ifp-modal-actions{
    flex-direction:column;
  }

  .ifp-modal-actions .ifp-btn-secondary,
  .ifp-modal-actions .ifp-btn-danger{
    width:100%;
  }
}

/* =====================================================
   POD Intelligence — Copy buttons + counters
===================================================== */

.ifp-field-block{
  display:block;
}

.ifp-field-label{
  font-size:11px;
  font-weight:700;
  color:#9ca3af;
  text-transform:uppercase;
  letter-spacing:.8px;
  margin-bottom:6px;
}

.ifp-field-container{
  position:relative;
  background:#f9fafb;
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:12px 52px 12px 14px;
  min-height:48px;
}

.ifp-field-text{
  font-size:14px;
  color:#111827;
  line-height:1.6;
  white-space:pre-wrap;
  word-break:break-word;
}

.ifp-field-tags{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.ifp-copy-btn{
  position:absolute;
  top:10px;
  right:10px;
  width:34px;
  height:34px;
  border:none;
  border-radius:8px;
  background:#ffffff;
  border:1px solid #d1d5db;
  color:#374151;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:all .18s ease;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
}

.ifp-copy-btn:hover{
  background:#f3f4f6;
  color:var(--brand);
  border-color:#cbd5e1;
}

.ifp-copy-btn.copied{
  background:#ecfdf5;
  color:#059669;
  border-color:#86efac;
}

.ifp-char-counter{
  margin-top:7px;
  font-size:12px;
  line-height:1.4;
  color:#6b7280;
}

.ifp-char-counter.ifp-success{
  color:#059669;
  font-weight:600;
}

.ifp-char-counter.ifp-warning{
  color:#d97706;
  font-weight:600;
}

.ifp-char-counter.ifp-danger{
  color:#dc2626;
  font-weight:600;
}

@media (max-width: 768px){
  .ifp-field-container{
    padding-right:50px;
  }

  .ifp-copy-btn{
    top:8px;
    right:8px;
    width:32px;
    height:32px;
  }
}

/* Ecommerce fields: altura y espaciado seguros */
#ifp-ecommerce-fields .ifp-ecommerce-grid select,
#ifp-ecommerce-fields .ifp-ecommerce-grid input {
  min-height: 48px;
  height: 48px;
  line-height: 1.2;
  box-sizing: border-box;
}

#ifp-ecommerce-fields .ifp-ecommerce-grid label {
  display: block;
  margin-bottom: 8px;
  line-height: 1.25;
}

#ifp-ecommerce-fields .ifp-ecommerce-grid > div {
  min-width: 0;
}
