/* ==========================================================================
   NESPL Portal — Interview form templates
   List, template builder (reusable: no dates), and the send flow where the
   interviewer supplies the slots. All classes use the .ivt- prefix.
   ========================================================================== */

@keyframes ivtRise { from { opacity:0; transform: translateY(16px); } to { opacity:1; transform:none; } }
@keyframes ivtPop  { from { opacity:0; transform: scale(.96); }      to { opacity:1; transform:none; } }
.ivt-in { animation: ivtRise .45s cubic-bezier(.2,.8,.2,1) both; }

/* ==========================================================================
   1. Hero
   ========================================================================== */
.ivt-hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3.5vw, 2.4rem); margin-bottom: 1.6rem; color: #fff;
  background: linear-gradient(125deg, #1e3a8a 0%, #2563eb 45%, #4f46e5 100%);
}
.ivt-hero::before, .ivt-hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.ivt-hero::before { width: 330px; height: 330px; right: -80px; top: -150px; background: rgba(255,255,255,.14); }
.ivt-hero::after  { width: 200px; height: 200px; right: 160px; bottom: -130px; background: rgba(255,255,255,.09); }

.ivt-hero__in { position: relative; z-index: 2; display: flex; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; }
.ivt-hero__text { flex: 1; min-width: 240px; }
.ivt-hero__eyebrow {
  display: inline-flex; align-items: center; gap: .45rem; font-size: .72rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.82);
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  padding: .3rem .7rem; border-radius: 999px; margin-bottom: .8rem;
}
.ivt-hero h1 { color: #fff; font-size: clamp(1.5rem, 3.4vw, 2.15rem); margin: 0 0 .45rem; letter-spacing: -.02em; }
.ivt-hero p { color: rgba(255,255,255,.84); margin: 0; font-size: .94rem; max-width: 56ch; }
.ivt-hero__stats { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1.4rem; }
.ivt-hero__stat b {
  display: block; font-family: var(--font-display); font-size: 1.7rem; line-height: 1; color: #fff;
  font-variant-numeric: tabular-nums;
}
.ivt-hero__stat span { font-size: .76rem; color: rgba(255,255,255,.74); letter-spacing: .04em; }
/* The hero CTA is the design system's own add button (.btn.btn-orange), not a
   bespoke white pill — only the icon/label spacing is needed here. */
.ivt-hero__in > .btn { display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; }

/* ==========================================================================
   2. Toolbar
   ========================================================================== */
.ivt-tools { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.ivt-search { position: relative; flex: 1 1 280px; max-width: 420px; }
.ivt-search input { padding-left: 2.7rem; height: 48px; border-radius: 14px; background: #fff; }
.ivt-search i {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.ivt-filter {
  height: 48px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff;
  padding: 0 2.4rem 0 1rem; font-family: var(--font-display); font-weight: 600; font-size: .88rem;
  color: var(--body); cursor: pointer; min-width: 150px;
}

/* ==========================================================================
   3. Table
   ========================================================================== */
.ivt-panel {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.ivt-table { width: 100%; border-collapse: collapse; }
.ivt-table thead th {
  background: linear-gradient(135deg, #1e3a8a, #2563eb); color: #fff;
  font-family: var(--font-display); font-weight: 600; font-size: .78rem;
  letter-spacing: .07em; text-transform: uppercase; text-align: left;
  padding: .95rem 1.2rem; white-space: nowrap;
}
.ivt-table thead th:last-child { text-align: right; }
.ivt-table tbody td { padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ivt-table tbody tr:last-child td { border-bottom: none; }
.ivt-table tbody tr { transition: background .18s; }
.ivt-table tbody tr:hover { background: var(--surface-2); }

.ivt-name { display: flex; align-items: center; gap: .85rem; }
.ivt-name__ico {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(135deg, #2563eb, #1e3a8a); color: #fff; font-size: 1rem;
  box-shadow: 0 6px 16px rgba(37,99,235,.26);
}
.ivt-name__t { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: .95rem; line-height: 1.3; }
.ivt-name__s { font-size: .78rem; color: var(--muted); margin-top: .1rem; }

.ivt-date { font-size: .88rem; color: var(--body); white-space: nowrap; }
.ivt-qcount {
  display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .65rem; border-radius: 8px;
  background: var(--blue-50); border: 1px solid var(--blue-100); color: var(--blue-700);
  font-size: .78rem; font-weight: 600; font-family: var(--font-display); white-space: nowrap;
}

.ivt-status {
  display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .75rem; border-radius: 999px;
  font-size: .76rem; font-weight: 700; font-family: var(--font-display); white-space: nowrap;
}
.ivt-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ivt-status.on  { background: var(--green-soft); color: #15803d; border: 1px solid #bbf7d0; }
.ivt-status.off { background: #eef1f6; color: #5b6b84; border: 1px solid var(--line); }

.ivt-acts { display: flex; gap: .45rem; justify-content: flex-end; }
.ivt-icon {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; cursor: pointer;
  display: grid; place-items: center; font-size: .9rem; transition: .2s;
  border: 1.5px solid var(--line); background: #fff; color: var(--muted);
}
.ivt-icon:hover { transform: translateY(-2px); }
.ivt-icon.edit:hover { border-color: var(--blue-400); color: var(--blue-600); background: var(--blue-50); }
.ivt-icon.del:hover  { border-color: #fecaca; color: #dc2626; background: #fef2f2; }
.ivt-icon:focus-visible { box-shadow: var(--ring); }

/* mobile: rows become cards */
.ivt-cell-k { display: none; }

/* ==========================================================================
   4. Footer + empty
   ========================================================================== */
.ivt-foot {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1.05rem 1.3rem; border-top: 1px solid var(--line); background: var(--surface-2);
}
.ivt-foot__per { display: flex; align-items: center; gap: .55rem; font-size: .86rem; color: var(--body); }
.ivt-foot__per select { width: auto; min-width: 74px; }
.ivt-foot__count { flex: 1; text-align: center; font-size: .86rem; color: var(--muted); min-width: 150px; }
.ivt-pager { display: flex; gap: .3rem; }
.ivt-pager button {
  min-width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff;
  color: var(--body); cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: .84rem;
  transition: .18s;
}
.ivt-pager button:hover:not(:disabled) { border-color: var(--blue-400); color: #1e3a8a; transform: translateY(-1px); }
.ivt-pager button.on {
  background: linear-gradient(135deg, #2563eb, #1e3a8a); border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px rgba(37,99,235,.3);
}
.ivt-pager button:disabled { opacity: .35; cursor: not-allowed; }

.ivt-empty { text-align: center; padding: 4rem 1rem; animation: ivtPop .4s both; }
.ivt-empty__ico {
  width: 88px; height: 88px; border-radius: 26px; margin: 0 auto 1.2rem; display: grid; place-items: center;
  background: var(--blue-50); color: var(--blue-400); font-size: 2.2rem;
}
.ivt-empty h6 { margin: 0 0 .4rem; font-size: 1.05rem; }
.ivt-empty p { color: var(--muted); font-size: .92rem; margin: 0 0 1.2rem; }

/* ==========================================================================
   5. Modals
   ========================================================================== */
.ivt-mhead {
  padding: 1.5rem 1.6rem 1.3rem; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(125deg, #1e3a8a, #2563eb 55%, #4f46e5);
}
.ivt-mhead::after {
  content: ""; position: absolute; right: -50px; top: -80px; width: 220px; height: 220px;
  border-radius: 50%; background: rgba(255,255,255,.13);
}
.ivt-mhead h5 { color: #fff; margin: 0 0 .2rem; position: relative; z-index: 2; font-size: 1.2rem; }
.ivt-mhead p { color: rgba(255,255,255,.8); margin: 0; font-size: .85rem; position: relative; z-index: 2; }
.ivt-mx {
  position: absolute; top: 1.1rem; right: 1.1rem; z-index: 3; width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.15); color: #fff; cursor: pointer;
  display: grid; place-items: center; transition: .18s;
}
.ivt-mx:hover { background: rgba(255,255,255,.28); }

.ivt-group { margin-bottom: 2rem; }
.ivt-group:last-child { margin-bottom: 0; }
.ivt-group__h {
  display: flex; align-items: center; gap: .6rem; margin-bottom: 1.1rem;
  font-family: var(--font-display); font-weight: 700; font-size: .77rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.ivt-group__h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ivt-group__n {
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 24px;
  background: var(--blue-50); color: #1e3a8a; font-size: .72rem; font-weight: 700;
}

/* --- question rows --- */
.ivt-qlist { display: flex; flex-direction: column; gap: .85rem; }
.ivt-q {
  display: flex; align-items: flex-start; gap: .8rem; padding: .9rem 1rem; border-radius: 14px;
  background: var(--surface-2); border: 1.5px solid var(--line); transition: border-color .2s, background .2s;
  animation: ivtRise .3s cubic-bezier(.2,.8,.2,1) both;
}
.ivt-q:focus-within { border-color: var(--blue-400); background: #fff; }
.ivt-q__n {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #2563eb, #1e3a8a); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: .76rem; margin-top: .3rem;
}
.ivt-q__body { flex: 1; min-width: 0; }
.ivt-q__body input { border-radius: 10px; }
.ivt-q__del {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; margin-top: .25rem;
  border: 1.5px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; transition: .18s;
}
.ivt-q__del:hover { border-color: #fecaca; color: #dc2626; background: #fef2f2; }

.ivt-add {
  width: 100%; padding: .8rem; border-radius: 13px; cursor: pointer; font-size: .89rem;
  font-family: var(--font-display); font-weight: 600; transition: .2s;
  background: var(--blue-50); color: #1e3a8a; border: 1.5px dashed var(--blue-200);
}
.ivt-add:hover { background: var(--blue-100); border-style: solid; }

/* --- status toggle --- */
.ivt-opts { display: flex; gap: .5rem; flex-wrap: wrap; }
.ivt-opt {
  border: 1.5px solid var(--line); background: #fff; color: var(--body);
  font-family: var(--font-display); font-weight: 600; font-size: .86rem;
  padding: .55rem 1.15rem; border-radius: 11px; cursor: pointer; transition: .18s;
  display: inline-flex; align-items: center; gap: .45rem;
}
.ivt-opt:hover { border-color: var(--blue-400); color: #1e3a8a; background: var(--blue-50); }
.ivt-opt.on {
  background: linear-gradient(135deg, #2563eb, #1e3a8a); border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px rgba(37,99,235,.28);
}
.ivt-opt.on.grey { background: linear-gradient(135deg,#94a3b8,#64748b); box-shadow: 0 8px 18px rgba(100,116,139,.28); }

/* ==========================================================================
   7. Responsive
   ========================================================================== */
@media (max-width: 760px) {
  /* table collapses into stacked cards */
  .ivt-table, .ivt-table tbody, .ivt-table tr, .ivt-table td { display: block; }
  .ivt-table, .ivt-table tbody, .ivt-table td { width: 100%; }
  .ivt-table thead { display: none; }
  /* padding on the body, not margins on the rows — margins would push each
     row past the table's own width and cause a horizontal spill */
  .ivt-table tbody { padding: .8rem; }
  .ivt-table tbody tr {
    width: auto; border: 1px solid var(--line); border-radius: 16px;
    margin: 0 0 .8rem; padding: .3rem 0; background: #fff;
  }
  .ivt-table tbody tr:last-child { margin-bottom: 0; }
  .ivt-table tbody tr:hover { background: #fff; }
  .ivt-table tbody td { border-bottom: 1px dashed var(--line); padding: .7rem 1rem; }
  .ivt-table tbody td:last-child { border-bottom: none; }
  .ivt-cell-k {
    display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); font-weight: 700; margin-bottom: .3rem;
  }
  .ivt-acts { justify-content: flex-start; }
}

@media (max-width: 700px) {
  .ivt-hero__in { flex-direction: column; align-items: stretch; }
  .ivt-hero__in > .btn { width: 100%; justify-content: center; }
  .ivt-hero__stats { gap: 1.4rem; }
  .ivt-hero__stat b { font-size: 1.4rem; }
  .ivt-search { max-width: none; }
  .ivt-foot__count { order: 3; flex: 1 1 100%; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .ivt-in, .ivt-q, .ivt-empty { animation: none; }
  .ivt-icon, .ivt-pager button { transition: none; }
  .ivt-icon:hover, .ivt-pager button:hover:not(:disabled) { transform: none; }
}


/* ==========================================================================
   8. Small secondary button
   ========================================================================== */
.ivt-btn-sm {
  display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .9rem; border-radius: 11px;
  font-family: var(--font-display); font-weight: 600; font-size: .84rem; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; color: var(--body); transition: .18s; white-space: nowrap;
}
.ivt-btn-sm:hover { border-color: var(--blue-400); color: #1e3a8a; background: var(--blue-50); transform: translateY(-1px); }

/* ==========================================================================
   9. Delete confirmation
   The reference carries these as inline styles on the dialog; they live here
   so the markup stays declarative.
   ========================================================================== */
.ivt-del { text-align: center; padding: 1rem .4rem 0; }
.ivt-del__ico {
  width: 66px; height: 66px; border-radius: 20px; margin: 0 auto 1.1rem; display: grid;
  place-items: center; font-size: 1.7rem; color: #fff;
  background: linear-gradient(135deg, #f87171, #dc2626);
  box-shadow: 0 12px 28px rgba(220, 38, 38, .3);
}
.btn.ivt-danger {
  background: linear-gradient(135deg, #f87171, #dc2626); color: #fff; border: none;
  box-shadow: 0 10px 24px rgba(220, 38, 38, .3);
}
.btn.ivt-danger:hover { filter: brightness(1.05); color: #fff; }
