:root {
  --ia-bg: #f6f8fc;
  --ia-bg-soft: #eef3fa;
  --ia-surface: #ffffff;
  --ia-surface-soft: rgba(255, 255, 255, 0.78);
  --ia-text: #11192d;
  --ia-text-muted: #5b6a83;
  --ia-border: rgba(17, 25, 45, 0.14);
  --ia-border-strong: rgba(17, 25, 45, 0.26);
  --ia-primary: #1459ff;
  --ia-primary-strong: #0f43c5;
  --ia-accent: #f06634;
  --ia-success: #0f8b5f;
  --ia-warning: #cb7f0c;
  --ia-danger: #cc3f2d;
  --ia-shadow: 0 16px 40px rgba(20, 36, 75, 0.11);
  --ia-radius-lg: 22px;
  --ia-radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 5%, rgba(240, 102, 52, 0.12), transparent 34%),
    radial-gradient(circle at 93% 0%, rgba(20, 89, 255, 0.12), transparent 38%),
    linear-gradient(165deg, #f5f8ff 0%, #eff5ff 48%, #f9f5ef 100%);
  color: var(--ia-text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: var(--ia-primary-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.ia-page {
  position: relative;
  isolation: isolate;
}

.ia-page::before,
.ia-page::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  filter: blur(42px);
  pointer-events: none;
}

.ia-page::before {
  top: -140px;
  left: -110px;
  background: rgba(20, 89, 255, 0.14);
}

.ia-page::after {
  right: -110px;
  top: 72px;
  background: rgba(240, 102, 52, 0.14);
}

.ia-container {
  width: min(1120px, calc(100% - 2.4rem));
  margin: 0 auto;
}

.ia-narrow {
  width: min(760px, calc(100% - 2.4rem));
  margin: 0 auto;
}

.ia-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.2rem;
}

.ia-auth-card {
  width: min(520px, 100%);
}

.ia-brand {
  font-family: "Sora", "IBM Plex Sans", sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.ia-title,
.ia-page h1,
.ia-page h2,
.ia-page h3 {
  margin: 0;
  font-family: "Sora", "IBM Plex Sans", sans-serif;
  letter-spacing: -0.015em;
}

.ia-muted {
  color: var(--ia-text-muted);
}

.ia-topbar {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(17, 25, 45, 0.08);
}

.ia-topbar__inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ia-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.ia-nav a {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  color: var(--ia-text-muted);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
  border: 1px solid transparent;
}

.ia-nav a:hover {
  background: rgba(20, 89, 255, 0.09);
  border-color: rgba(20, 89, 255, 0.18);
  color: var(--ia-primary-strong);
}

.ia-nav a.is-active {
  background: rgba(20, 89, 255, 0.14);
  border-color: rgba(20, 89, 255, 0.23);
  color: var(--ia-primary-strong);
}

.ia-card {
  background: var(--ia-surface-soft);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--ia-shadow);
  border-radius: var(--ia-radius-lg);
  backdrop-filter: blur(8px);
}

.ia-card--tight {
  padding: 1.05rem 1.25rem;
}

.ia-card--pad {
  padding: 1.4rem;
}

.ia-card--deep {
  padding: 1.8rem;
}

.ia-analysis-card {
  display: block;
  position: relative;
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.ia-analysis-card:hover,
.ia-analysis-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(20, 89, 255, 0.35);
  box-shadow: 0 18px 46px rgba(20, 36, 75, 0.16);
}

.ia-analysis-card:focus-visible {
  outline: 3px solid rgba(20, 89, 255, 0.34);
  outline-offset: 3px;
}

.ia-grid {
  display: grid;
  gap: 1rem;
}

.ia-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ia-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ia-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ia-kpi-label {
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ia-text-muted);
  font-weight: 700;
}

.ia-kpi-value {
  margin-top: 0.4rem;
  font-size: clamp(1.1rem, 1.65vw, 1.5rem);
  font-family: "Sora", "IBM Plex Sans", sans-serif;
  font-weight: 700;
}

.ia-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.62rem 1.05rem;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
  text-decoration: none;
}

.ia-button:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.ia-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.ia-button--primary {
  background: linear-gradient(135deg, var(--ia-primary) 0%, #2f7bff 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(20, 89, 255, 0.28);
}

.ia-button--primary:hover {
  box-shadow: 0 13px 26px rgba(20, 89, 255, 0.32);
}

.ia-button--accent {
  background: linear-gradient(135deg, var(--ia-accent) 0%, #e5802f 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(240, 102, 52, 0.28);
}

.ia-button--subtle {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ia-text);
  border-color: var(--ia-border);
}

.ia-button--subtle:hover {
  border-color: var(--ia-border-strong);
  background: #fff;
}

.ia-button--ghost {
  background: transparent;
  color: var(--ia-text-muted);
  border-color: var(--ia-border);
}

.ia-input,
.ia-textarea,
.ia-select {
  width: 100%;
  border: 1px solid var(--ia-border);
  border-radius: 14px;
  background: #fff;
  color: var(--ia-text);
  font: inherit;
  font-size: 0.96rem;
  padding: 0.72rem 0.85rem;
  outline: none;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}

.ia-input:focus,
.ia-textarea:focus,
.ia-select:focus {
  border-color: rgba(20, 89, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(20, 89, 255, 0.14);
}

.ia-textarea {
  resize: vertical;
  min-height: 112px;
}

.ia-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ia-text-muted);
}

.ia-helper {
  margin-top: 0.28rem;
  font-size: 0.82rem;
  color: var(--ia-text-muted);
}

.ia-error-list,
.errorlist {
  margin: 0.45rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  list-style: none;
  font-size: 0.84rem;
  color: var(--ia-danger);
  background: rgba(204, 63, 45, 0.12);
  border: 1px solid rgba(204, 63, 45, 0.26);
}

.ia-alert {
  border-radius: 14px;
  padding: 0.72rem 0.88rem;
  font-size: 0.9rem;
  border: 1px solid;
}

.ia-alert--error {
  background: rgba(204, 63, 45, 0.1);
  border-color: rgba(204, 63, 45, 0.3);
  color: #8f281c;
}

.ia-alert--success {
  background: rgba(15, 139, 95, 0.12);
  border-color: rgba(15, 139, 95, 0.26);
  color: #0f6a47;
}

.ia-alert--info {
  background: rgba(20, 89, 255, 0.1);
  border-color: rgba(20, 89, 255, 0.26);
  color: #1347bc;
}

.ia-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.62rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(17, 25, 45, 0.16);
  color: var(--ia-text-muted);
  background: rgba(255, 255, 255, 0.85);
}

.ia-badge[data-tone="success"] {
  color: #0f6d4a;
  border-color: rgba(15, 139, 95, 0.3);
  background: rgba(15, 139, 95, 0.14);
}

.ia-badge[data-tone="warning"] {
  color: #946013;
  border-color: rgba(203, 127, 12, 0.33);
  background: rgba(203, 127, 12, 0.14);
}

.ia-badge[data-tone="danger"] {
  color: #942f20;
  border-color: rgba(204, 63, 45, 0.32);
  background: rgba(204, 63, 45, 0.15);
}

.ia-badge[data-tone="brand"] {
  color: #1144be;
  border-color: rgba(20, 89, 255, 0.35);
  background: rgba(20, 89, 255, 0.15);
}

.ia-section {
  margin-top: 1.35rem;
}

.ia-section-head {
  margin-bottom: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.ia-section-title {
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
}

.ia-empty {
  text-align: center;
  padding: 2.35rem 1rem;
}

.ia-empty h3 {
  font-size: 1.25rem;
}

.ia-table {
  width: 100%;
  border-collapse: collapse;
}

.ia-table th,
.ia-table td {
  text-align: left;
  padding: 0.78rem 0.7rem;
  border-bottom: 1px solid rgba(17, 25, 45, 0.08);
}

.ia-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ia-text-muted);
}

.ia-toast-stack {
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 50;
  width: min(420px, calc(100% - 2rem));
  display: grid;
  gap: 0.55rem;
}

.ia-toast {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(17, 25, 45, 0.14);
  box-shadow: 0 14px 30px rgba(17, 25, 45, 0.16);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.68rem 0.75rem;
}

.ia-toast__content {
  font-size: 0.89rem;
  color: var(--ia-text);
  flex: 1;
}

.ia-toast__dismiss {
  border: 0;
  background: transparent;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--ia-text-muted);
  cursor: pointer;
  padding: 0.02rem 0.2rem;
}

.ia-impersonation {
  background: linear-gradient(90deg, rgba(245, 146, 40, 0.18), rgba(249, 181, 34, 0.16));
  border-bottom: 1px solid rgba(181, 111, 13, 0.34);
}

.ia-impersonation__inner {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #5c3f13;
  font-weight: 600;
}

.ia-hero {
  padding: 4rem 0 3.2rem;
}

.ia-hero-grid {
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: 1.3rem;
  align-items: stretch;
}

.ia-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--ia-text-muted);
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--ia-border);
  background: rgba(255, 255, 255, 0.74);
}

.ia-hero h1 {
  margin-top: 1rem;
  font-size: clamp(1.95rem, 5vw, 3.45rem);
  line-height: 1.08;
}

.ia-hero p {
  margin-top: 0.9rem;
  color: var(--ia-text-muted);
  font-size: 1.04rem;
}

.ia-hero-actions {
  margin-top: 1.3rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.ia-stats {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.ia-stat {
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  padding: 0.72rem;
}

.ia-stat strong {
  display: block;
  font-family: "Sora", "IBM Plex Sans", sans-serif;
  font-size: 1.1rem;
}

.ia-workflow {
  margin-top: 2rem;
}

.ia-workflow .ia-card {
  min-height: 100%;
}

.ia-feature-row {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.ia-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.54rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid rgba(17, 25, 45, 0.2);
  background: rgba(255, 255, 255, 0.82);
}

.ia-page-main {
  padding: 1.5rem 0 2rem;
}

.ia-upload-shell {
  width: min(920px, calc(100% - 2.4rem));
  margin: 0 auto;
}

.ia-upload-zones {
  display: grid;
  gap: 0.92rem;
}

.ia-dropzone {
  position: relative;
  border: 1px dashed rgba(17, 25, 45, 0.3);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
  padding: 1rem;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  overflow: hidden;
  cursor: pointer;
}

.ia-dropzone.is-dragover {
  border-color: rgba(20, 89, 255, 0.52);
  background: linear-gradient(130deg, rgba(20, 89, 255, 0.1), rgba(240, 102, 52, 0.08));
  border-style: solid;
  transform: translateY(-1px);
  box-shadow: 0 18px 33px rgba(20, 89, 255, 0.16);
}

.ia-dropzone.is-dragover::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(20, 89, 255, 0.24);
  border-radius: 15px;
  animation: ia-borderWave 1.2s linear infinite;
  pointer-events: none;
}

.ia-dropzone.is-dropped {
  animation: ia-dropPulse 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ia-dropzone__hint {
  position: relative;
  z-index: 1;
}

.ia-dropzone__hint {
  margin: 0.62rem 0 0;
  font-size: 0.78rem;
  color: var(--ia-primary-strong);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 140ms ease, max-height 180ms ease;
}

.ia-dropzone.is-dragover .ia-dropzone__hint {
  opacity: 1;
  max-height: 24px;
}

.ia-dropzone__files {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.45rem;
}

.ia-dropzone__file {
  border-radius: 12px;
  border: 1px solid rgba(17, 25, 45, 0.14);
  padding: 0.56rem 0.7rem;
  background: rgba(255, 255, 255, 0.84);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  transition: border-color 130ms ease, background-color 130ms ease, transform 130ms ease;
}

.ia-dropzone__file:hover {
  border-color: rgba(20, 89, 255, 0.34);
  background: rgba(20, 89, 255, 0.08);
  transform: translateX(2px);
}

.ia-dropzone__file-row {
  min-width: 0;
}

.ia-dropzone__file-name {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--ia-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ia-dropzone__file-size {
  font-size: 0.75rem;
  color: var(--ia-text-muted);
}

.ia-dropzone__file-remove {
  border: 0;
  border-radius: 999px;
  padding: 0.32rem 0.58rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ia-text-muted);
  background: rgba(17, 25, 45, 0.08);
  cursor: pointer;
  transition: background-color 130ms ease, color 130ms ease;
}

.ia-dropzone__file-remove:hover {
  background: rgba(204, 63, 45, 0.2);
  color: #a22b1b;
}

@keyframes ia-borderWave {
  0% {
    opacity: 0.2;
    transform: scale(0.96);
  }

  55% {
    opacity: 0.95;
    transform: scale(1.02);
  }

  100% {
    opacity: 0.2;
    transform: scale(1);
  }
}

@keyframes ia-dropPulse {
  0% {
    transform: translateY(-1px) scale(1);
    box-shadow: 0 10px 22px rgba(20, 89, 255, 0.18);
  }

  50% {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 20px 32px rgba(240, 102, 52, 0.2);
  }

  100% {
    transform: translateY(0) scale(1);
    box-shadow: none;
  }
}

.ia-dropzone-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.ia-file-meta {
  margin-top: 0.45rem;
  font-size: 0.84rem;
  color: var(--ia-text-muted);
}

.ia-progress-shell {
  margin-top: 1rem;
  border-radius: 15px;
  border: 1px solid rgba(17, 25, 45, 0.12);
  background: rgba(255, 255, 255, 0.84);
  padding: 0.9rem;
}

.ia-progress-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(17, 25, 45, 0.12);
  overflow: hidden;
}

.ia-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ia-primary), var(--ia-accent));
  transition: width 220ms ease;
}

.ia-stage-list {
  display: grid;
  gap: 0.58rem;
  margin-top: 0.9rem;
}

.ia-stage-item {
  border: 1px solid rgba(17, 25, 45, 0.12);
  border-radius: 12px;
  padding: 0.62rem 0.7rem;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.86rem;
}

.ia-stage-item[data-state="complete"] {
  border-color: rgba(15, 139, 95, 0.28);
  background: rgba(15, 139, 95, 0.1);
}

.ia-stage-item[data-state="active"] {
  border-color: rgba(20, 89, 255, 0.32);
  background: rgba(20, 89, 255, 0.1);
}

.ia-analysis-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.ia-match-list {
  display: grid;
  gap: 0.78rem;
}

.ia-match-card {
  border-radius: 17px;
  border: 1px solid rgba(17, 25, 45, 0.11);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.9);
}

.ia-match-meta {
  margin-bottom: 0.35rem;
  font-size: 0.79rem;
  color: var(--ia-text-muted);
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.ia-match-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.38;
}

.ia-match-detail {
  margin-top: 0.6rem;
  border-radius: 12px;
  background: rgba(17, 25, 45, 0.05);
  border: 1px solid rgba(17, 25, 45, 0.08);
  padding: 0.63rem 0.72rem;
  font-size: 0.88rem;
}

.ia-divider {
  height: 1px;
  background: rgba(17, 25, 45, 0.11);
  margin: 1rem 0;
}

.ia-list {
  margin: 0;
  padding-left: 1rem;
}

.ia-list li {
  margin-top: 0.34rem;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 320ms ease, transform 320ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .ia-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ia-hero-grid,
  .ia-feature-row,
  .ia-analysis-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .ia-container,
  .ia-narrow,
  .ia-upload-shell {
    width: min(1120px, calc(100% - 1.4rem));
  }

  .ia-topbar__inner {
    min-height: 64px;
  }

  .ia-nav {
    gap: 0.4rem;
  }

  .ia-nav a {
    padding: 0.42rem 0.72rem;
    font-size: 0.84rem;
  }

  .ia-grid--3,
  .ia-grid--2,
  .ia-grid--4,
  .ia-stats {
    grid-template-columns: 1fr;
  }

  .ia-card--deep {
    padding: 1.25rem;
  }

  .ia-toast-stack {
    right: 0.65rem;
    top: 0.65rem;
    width: calc(100% - 1.3rem);
  }
}
