﻿:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --line: #dbe3ef;
  --text: #14213d;
  --muted: #69758a;
  --blue: #315cff;
  --blue-dark: #173899;
  --success: #0f8a5f;
  --danger: #c43737;
  --shadow: 0 18px 50px rgba(20, 33, 61, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 48px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(219, 227, 239, 0.72);
  backdrop-filter: blur(12px);
}

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

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #ffffff;
  background: #10254f;
  border-radius: 7px;
  font-size: 11px;
  letter-spacing: 0;
}

.top-nav {
  align-items: center;
  display: flex;
  gap: 32px;
}

.top-nav a,
.login-nav-button,
.logout-button {
  color: #59677d;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.top-nav a:hover,
.login-nav-button:hover,
.logout-button:hover {
  color: var(--blue);
}

.login-nav-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
}

.login-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #ffffff;
  background: #10254f;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
}

.logout-button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #edf3ff;
  cursor: pointer;
}

.hero {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 82px 0 44px;
}

.hero-copy {
  max-width: 760px;
  margin: 0 auto 30px;
  text-align: center;
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(40px, 6vw, 70px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 22px;
  letter-spacing: 0;
}

.hero-description,
.info-section p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.workspace {
  display: flex;
  justify-content: center;
}

.login-panel,
.upload-card,
.summary-card,
.result-card,
.dashboard-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  padding: 24px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #526078;
  background: #ffffff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  color: var(--blue);
  border-color: #b9c7ff;
  background: #f5f8ff;
}

.form-helper {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 16px;
  padding: 4px;
  background: #edf3ff;
  border-radius: 8px;
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: #526078;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.auth-tab.active {
  color: var(--blue-dark);
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(20, 33, 61, 0.08);
}

.demo-hint {
  margin-top: 14px;
  color: #59677d;
  font-size: 13px;
}

.demo-hint summary {
  cursor: pointer;
  font-weight: 800;
}

.demo-hint ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.panel-heading {
  margin-bottom: 18px;
}

.login-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: #46546b;
  font-size: 13px;
  font-weight: 700;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  outline: none;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 92, 255, 0.12);
}

.action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 4px;
}

.primary-button,
.ghost-button,
.analyze-button {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button,
.analyze-button {
  color: #ffffff;
  background: var(--blue);
}

.primary-button:hover,
.analyze-button:hover {
  background: var(--blue-dark);
}

.ghost-button {
  color: var(--blue-dark);
  background: #edf3ff;
}

.ghost-button:hover {
  background: #e2ebff;
}

.message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.current-user {
  margin: 20px 24px 0;
  padding: 12px 14px;
  background: #f3f7ff;
  border: 1px solid #d6e2ff;
  border-radius: 7px;
  color: #3d4b63;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.upload-card {
  width: min(680px, 100%);
  overflow: hidden;
}

.tab-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: 58px;
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  border: 0;
  background: transparent;
  color: #59677d;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.tab.active {
  color: var(--blue);
}

.tab.active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--blue);
  border-radius: 4px 4px 0 0;
  content: "";
}

.drop-zone {
  display: grid;
  min-height: 220px;
  margin: 24px;
  padding: 28px;
  place-items: center;
  border: 1px dashed #bfcbe0;
  border-radius: 7px;
  background: #fbfdff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--blue);
  background: #f3f7ff;
  transform: translateY(-2px);
}


.workspace-panel.hidden {
  display: none;
}

.history-panel {
  padding: 24px;
}

.history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.history-heading h2 {
  margin-bottom: 0;
}

.history-state {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: #46546b;
  text-align: center;
}

.history-state p {
  margin: 8px 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.history-result-button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #c8d4ff;
  border-radius: 7px;
  color: var(--blue-dark);
  background: #edf3ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.history-result-button:hover {
  background: #e2ebff;
}

.history-result-button:disabled {
  cursor: not-allowed;
  opacity: 0.64;
}

.request-id-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-input-hidden {
  display: none;
}

.upload-icon {
  display: grid;
  width: 68px;
  height: 68px;
  margin-bottom: 12px;
  place-items: center;
  color: var(--blue);
  background: #eaf0ff;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 800;
}

.drop-zone h2 {
  margin-bottom: 7px;
  font-size: 18px;
}

.drop-zone p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.file-name {
  margin: 0 24px 14px;
  color: #46546b;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.analyze-button {
  display: block;
  width: min(240px, calc(100% - 48px));
  margin: 0 auto;
}

.analyze-button:disabled {
  cursor: not-allowed;
  background: #9aa8c2;
}

.privacy-note {
  max-width: 520px;
  margin: 20px auto 28px;
  color: #7b8799;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.result-band,
.info-section,
.dashboard-section {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto 32px;
}

.result-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.summary-card,
.result-card,
.dashboard-section {
  padding: 24px;
}

.summary-list,
.result-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
  color: #69758a;
  font-size: 14px;
}

.row strong {
  color: var(--text);
  text-align: right;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.status-success {
  color: #ffffff;
  background: var(--success);
}

.status-failed {
  color: #ffffff;
  background: var(--danger);
}

.info-section {
  padding: 30px 0;
}

.info-section > div {
  max-width: 760px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  min-height: 108px;
  padding: 18px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-card span {
  display: block;
  margin-bottom: 10px;
  color: #69758a;
  font-size: 13px;
  font-weight: 800;
}

.metric-card strong {
  color: var(--text);
  font-size: 24px;
}

.table-wrap {
  margin-top: 20px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
}

th {
  color: #59677d;
  font-size: 12px;
  text-transform: uppercase;
}

.hidden {
  display: none;
}

@media (max-width: 900px) {
  .site-header {
    padding: 0 20px;
  }

  .result-band {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .history-heading {
    display: grid;
  }

  .history-heading .ghost-button {
    width: 100%;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
  }

  .top-nav {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .login-nav-button {
    padding: 0 10px;
  }

  .hero {
    padding-top: 48px;
  }

  h1 {
    font-size: 42px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }
}
