@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ─── Design Tokens ───────────────────────────────────────────── */
:root {
  --blue-900: #0a2540;
  --blue-700: #0F4D70;
  --blue-500: #1a6fa0;
  --blue-400: #2e8ec8;
  --blue-100: #e8f4fd;
  --blue-50:  #f0f8ff;

  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;

  --accent:    #00c2a8;
  --error:     #dc2626;
  --error-bg:  #fef2f2;
  --success:   #16a34a;
  --success-bg:#f0fdf4;
  --white: #ffffff;

  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(10,37,64,0.08);
  --shadow-md: 0 4px 16px rgba(10,37,64,0.10);
  --shadow-card: 0 0 0 1px rgba(10,37,64,0.06), 0 4px 24px rgba(10,37,64,0.08);

  /* Legacy compatibility */
  --InsitelyBlue: #0F4D70;
  --InsitelyGrey: #95A3AB;
  --InsitelyBlack: #1e293b;
  --ColorWrong: #dc2626;
  --InsitelyFont1: 'DM Sans', system-ui, sans-serif;
  --SoftWhite: #f8fafc;
  --TextColor1: var(--blue-900);
  --TextColor1Wrong: var(--error);
  --TextColor2: var(--slate-800);
  --BackgroundColor: var(--slate-50);
  --ButtonTextColor1: var(--white);
  --ButtonBackgroundColor1: var(--blue-700);
}

/* ─── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  background: var(--slate-50);
  color: var(--slate-800);
  min-height: 100vh;
  line-height: 1.6;
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(15,77,112,0.07) 0%, transparent 65%);
}

/* ─── Page Layout ────────────────────────────────────────────────── */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(10,37,64,0.06);
  padding: 2.5rem;
  width: 100%;
  max-width: 520px;
  animation: fadeUp 0.35s ease both;
}

.card-wide { max-width: 700px; }

.card-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--slate-100);
}

/* ─── Logo ──────────────────────────────────────────────────────── */
.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.logo-wrap img {
  height: 52px;
  width: auto;
  border-radius: var(--radius-sm);
}

/* ─── Typography ─────────────────────────────────────────────────── */
.clsh1style {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--blue-900);
  letter-spacing: -0.04em;
  line-height: 1.2;
  text-align: center;
}
.clsh2style {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--blue-900);
  letter-spacing: -0.025em;
  line-height: 1.3;
  text-align: center;
}
.clsh3style {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--slate-600);
  text-align: center;
  line-height: 1.65;
}
.clslabelstyle {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--slate-600);
  letter-spacing: 0.01em;
  display: block;
  margin-bottom: 0.375rem;
}
.clspstyle {
  font-size: 0.9375rem;
  color: var(--slate-600);
  text-align: center;
  line-height: 1.6;
}

/* ─── Form Elements ──────────────────────────────────────────────── */
.form-group { margin-bottom: 1.125rem; }

.clsTextField,
.clsTextFieldwide {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--slate-800);
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 0.6875rem 0.875rem;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  appearance: none;
}
.clsTextField:hover, .clsTextFieldwide:hover { border-color: var(--slate-400); }
.clsTextField:focus, .clsTextFieldwide:focus {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(46,142,200,0.12);
}

select.clsTextField {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

/* ─── Checkbox Cards ─────────────────────────────────────────────── */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0 1.25rem;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--white);
}
.checkbox-item:hover { border-color: var(--blue-400); background: var(--blue-50); }
.checkbox-item input[type="checkbox"] {
  width: 1.0625rem;
  height: 1.0625rem;
  accent-color: var(--blue-700);
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox-label {
  font-size: 0.9rem;
  color: var(--slate-700);
  font-weight: 400;
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.clsbuttonstyle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--white);
  background: var(--blue-700);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.75rem;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  letter-spacing: -0.01em;
  width: 100%;
  box-shadow: 0 1px 2px rgba(10,37,64,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
}
.clsbuttonstyle:hover {
  background: var(--blue-500);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(10,37,64,0.22);
}
.clsbuttonstyle:active { transform: translateY(0); }

.btn-secondary {
  background: var(--white);
  color: var(--blue-700);
  border: 1.5px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--slate-50); border-color: var(--blue-400); }

/* ─── Status / Feedback Cards ────────────────────────────────────── */
.status-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.75rem;
}
.status-icon.success { background: var(--success-bg); }
.status-icon.error   { background: var(--error-bg); }
.status-icon.info    { background: var(--blue-100); }

.error-card  { border-top: 3px solid var(--error) !important; }
.success-card{ border-top: 3px solid var(--accent) !important; }

/* ─── Health Badge ────────────────────────────────────────────────── */
.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(22,163,74,0.25);
  border-radius: 999px;
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 1rem;
}
.health-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.5; transform:scale(0.8); }
}

/* ─── Dropzone ────────────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--slate-50);
  margin: 1.25rem 0;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--blue-400);
  background: var(--blue-50);
}
.dropzone-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.dropzone .file-name {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--blue-700);
  background: var(--blue-50);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.75rem;
  display: inline-block;
}

/* ─── Search Group ────────────────────────────────────────────────── */
.search-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 1.25rem 0;
}
.search-group .clsTextField {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.06em;
}
.search-group .clsbuttonstyle { width: auto; white-space: nowrap; }

/* ─── Divider ─────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--slate-100); margin: 1.5rem 0; }

/* ─── Section labels ──────────────────────────────────────────────── */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-400);
  margin-bottom: 0.625rem;
}

/* ─── Code / API key display ──────────────────────────────────────── */
.mono-field {
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

/* ─── Animations ──────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(14px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ─── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .card { padding: 1.75rem 1.25rem; border-radius: var(--radius-lg); }
  .clsh1style { font-size: 1.4rem; }
  .clsh2style { font-size: 1.1rem; }
  .search-group { flex-direction: column; }
  .search-group .clsbuttonstyle { width: 100%; }
}
