/* ---- CHI 311 look-alike -------------------------------------------------- */

:root {
  --chi-red: #d02b2b;
  --chi-red-dark: #b81f28;
  --chi-blue: #41b6e6;
  --link-blue: #1a73c4;
  --navy: #14407c;
  --navy-dark: #0f3161;
  --ink: #1f1f1f;
  --muted: #5c5c5c;
  --hero-bg: #e7e7e7;
  --line: #d8d8d8;
  --skyline: #c9d8e8;
  --skyline-red: #f0d5d5;
  --shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--link-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header -------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid #eee;
  position: relative;
  z-index: 20;
  gap: 16px;
}

.logo { display: flex; align-items: center; gap: 0; text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo svg { display: block; height: 52px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 28px; }

.site-nav a.nav-link {
  color: #3d3d3d;
  font-size: 13.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 400;
  white-space: nowrap;
}
.site-nav a.nav-link:hover { color: var(--link-blue); text-decoration: none; }
.site-nav a.nav-link.active { color: var(--navy); font-weight: 600; }

.btn-login,
.btn-signup {
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: 3px;
  white-space: nowrap;
}
.btn-login { background: var(--navy); color: #fff; border: 2px solid var(--navy); }
.btn-login:hover { background: var(--navy-dark); text-decoration: none; }
.btn-signup { background: #fff; color: var(--navy); border: 2px solid var(--navy); }
.btn-signup:hover { background: #f2f6fc; text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px 10px;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: #444; margin: 4px 0; }

/* ---- Home hero ----------------------------------------------------------- */

.hero {
  position: relative;
  background: var(--hero-bg);
  overflow: hidden;
  padding: 26px 20px 262px;
}

.hero-skyline {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; }

.lang-note {
  text-align: center;
  font-size: 12.5px;
  color: #444;
  direction: rtl;
  margin-bottom: 120px;
}

.hero h1 {
  text-align: center;
  font-size: 44px;
  letter-spacing: .01em;
  font-weight: 700;
  margin: 0 0 8px;
  text-transform: uppercase;
}
.hero h1 .accent { color: var(--link-blue); }

.hero-sub { text-align: center; color: #333; margin: 0 0 22px; font-size: 15px; }

.search-wrap { max-width: 770px; margin: 0 auto; position: relative; }

.search-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  font-size: 14.5px;
  background: #fff;
  color: var(--ink);
}
.search-input::placeholder { color: #8a8a8a; }
.search-input:focus { outline: none; border-color: var(--link-blue); box-shadow: 0 0 0 3px rgba(26, 115, 196, .15); }

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a8a8a;
  pointer-events: none;
}

/* ---- Home cards ---------------------------------------------------------- */

.cards {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  transform: translateY(-133px);
  margin-bottom: -73px;
}

.card {
  background: #fff;
  box-shadow: var(--shadow);
  padding: 30px 22px 26px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 6px solid #d9d9d9;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
  border-bottom-color: var(--chi-red);
}
.card svg { height: 86px; width: auto; margin-bottom: 22px; }
.card h3 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin: 0 0 10px;
  font-weight: 700;
}
.card p { margin: 0; color: #444; font-size: 14.5px; }

/* ---- How it works -------------------------------------------------------- */

.how {
  max-width: 1100px;
  margin: 0 auto;
  padding: 46px 20px 70px;
}
.how-title {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
}
.how-title::before,
.how-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.how-title h2 {
  font-size: 30px;
  text-transform: uppercase;
  margin: 0;
  font-weight: 700;
  letter-spacing: .01em;
}
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.step { text-align: center; }
.step-num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--chi-red);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 18px;
}
.step h4 { margin: 0 0 6px; font-size: 15px; text-transform: uppercase; letter-spacing: .03em; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---- Page banner (service request) --------------------------------------- */

.page-banner {
  position: relative;
  background: var(--hero-bg);
  overflow: hidden;
  padding: 44px 20px 46px;
  text-align: center;
}
.banner-skyline { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.page-banner h1 {
  position: relative;
  z-index: 2;
  margin: 0 0 10px;
  font-size: 34px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .02em;
}
.banner-stars { position: relative; z-index: 2; display: flex; justify-content: center; gap: 14px; }
.banner-stars svg { width: 26px; height: 26px; }

/* ---- Tabs ---------------------------------------------------------------- */

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin: 46px 0 0;
}
.tab {
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: none;
  padding: 11px 22px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--link-blue);
  cursor: pointer;
  border-radius: 3px 3px 0 0;
  position: relative;
  bottom: -1px;
}
.tab[aria-selected="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

.tab-panel { padding: 30px 0 70px; }
.tab-panel[hidden] { display: none !important; }

/* ---- Form ---------------------------------------------------------------- */

.field-label { display: block; font-size: 14.5px; margin-bottom: 7px; color: #2c2c2c; }
.field-label .req { color: var(--chi-red); }

.intro { font-size: 14.5px; color: #333; margin: 0 0 20px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.form-grid .full { grid-column: 1 / -1; }

.text-input,
.textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
.textarea { min-height: 92px; resize: vertical; }
.text-input:focus,
.textarea:focus { outline: none; border-color: var(--link-blue); box-shadow: 0 0 0 3px rgba(26, 115, 196, .15); }

.section-heading {
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  margin: 34px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--chi-red);
  display: inline-block;
}

/* ---- Dropzone ------------------------------------------------------------ */

.dropzone {
  display: block;
  border: 2px dashed #b9c6d6;
  border-radius: 6px;
  background: #f7f9fc;
  padding: 38px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover,
.dropzone.dragover { border-color: var(--link-blue); background: #eef4fb; }
.dropzone.has-file { border-style: solid; border-color: var(--link-blue); background: #fff; }
.dropzone svg { color: var(--link-blue); margin-bottom: 12px; }
.dropzone-title { font-weight: 700; font-size: 15px; margin-bottom: 5px; }
.dropzone-hint { color: var(--muted); font-size: 13.5px; }
.dropzone input[type="file"] { display: none; }

.preview-row { display: flex; gap: 18px; align-items: center; text-align: left; }
.preview-row img {
  width: 132px;
  height: 132px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.preview-meta { flex: 1; min-width: 0; }
.preview-name { font-weight: 700; word-break: break-all; margin-bottom: 4px; }
.preview-size { color: var(--muted); font-size: 13.5px; }
.link-btn {
  background: none;
  border: none;
  color: var(--link-blue);
  cursor: pointer;
  padding: 0;
  font-size: 13.5px;
  text-decoration: underline;
  margin-top: 8px;
}

/* ---- Buttons ------------------------------------------------------------- */

.actions { display: flex; align-items: center; gap: 16px; margin-top: 28px; flex-wrap: wrap; }

.btn-primary {
  background: var(--chi-red);
  color: #fff;
  border: none;
  padding: 13px 34px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
}
.btn-primary:hover:not(:disabled) { background: var(--chi-red-dark); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--navy);
  padding: 11px 24px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
}
.btn-secondary:hover { background: #f2f6fc; }

/* ---- Status / progress --------------------------------------------------- */

.status-box {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--link-blue);
  background: #f7f9fc;
  padding: 18px 20px;
  border-radius: 4px;
}
.status-box.error { border-left-color: var(--chi-red); background: #fdf3f3; }
.status-title { font-weight: 700; margin-bottom: 10px; }

.progress-steps { list-style: none; margin: 0; padding: 0; }
.progress-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  color: var(--muted);
  font-size: 14px;
}
.progress-steps li.active { color: var(--ink); font-weight: 600; }
.progress-steps li.done { color: #1c7c3f; }
.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #c3ccd6;
  flex-shrink: 0;
}
li.active .dot { border-color: var(--link-blue); border-top-color: transparent; animation: spin .8s linear infinite; }
li.done .dot { border-color: #1c7c3f; background: #1c7c3f; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- AI-filled form fields ---------------------------------------------- */

.ai-note {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 16px;
}

.ai-badge {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: 1px;
}

select.text-input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 11px;
  padding-right: 34px;
}

.status-box.analyzed { border-left-color: #1c7c3f; background: #f2f7f3; }

#details-section[hidden],
#workorder-section[hidden] { display: none !important; }

/* ---- Results ------------------------------------------------------------- */

#result { margin-top: 26px; }

.result-header {
  background: #f2f7f3;
  border: 1px solid #bcd9c4;
  border-left: 4px solid #1c7c3f;
  padding: 18px 20px;
  border-radius: 4px;
  margin-bottom: 24px;
}
.result-header h3 { margin: 0 0 6px; font-size: 17px; }
.sr-number { font-size: 22px; font-weight: 700; letter-spacing: .04em; color: var(--navy); }

.result-cols { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; }
.result-photo img { width: 100%; border-radius: 4px; border: 1px solid var(--line); display: block; }
.result-photo .box-meta { margin-top: 12px; font-size: 13px; color: var(--muted); }
.result-photo .box-meta div { margin-bottom: 4px; word-break: break-all; }

.classification {
  background: var(--navy);
  color: #fff;
  padding: 16px 20px;
  border-radius: 4px;
  margin-bottom: 18px;
}
.classification .label {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .8;
  margin-bottom: 4px;
}
.classification .value { font-size: 22px; font-weight: 700; }

.badges { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid;
}
.badge.high { background: #fdf3f3; color: var(--chi-red-dark); border-color: #e7b5b5; }
.badge.medium { background: #fff7ea; color: #9a6216; border-color: #e8cf9f; }
.badge.low { background: #f2f7f3; color: #1c7c3f; border-color: #bcd9c4; }
.badge.neutral { background: #f4f6f9; color: #46536b; border-color: #ccd5e2; }

/* ---- Salesforce outcome -------------------------------------------------- */

.sf-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 4px;
  font-size: 13.5px;
  border: 1px solid;
  border-left-width: 4px;
}
.sf-box.created { background: #f2f7fb; border-color: #b9d3ea; border-left-color: #0176d3; }
.sf-box.failed { background: #fdf3f3; border-color: #e7b5b5; border-left-color: var(--chi-red); }
.sf-title { font-weight: 700; margin-bottom: 8px; color: #1f1f1f; }
.sf-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.sf-row span { color: var(--muted); }
.sf-filing { margin-top: 10px; padding-top: 10px; border-top: 1px solid #d5e3f0; }
.sf-filing.bad { color: var(--chi-red-dark); }
.sf-tag { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.sf-steps { margin: 6px 0 0; padding-left: 20px; }
.sf-steps li { margin: 2px 0; }

table.extract { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.extract th,
table.extract td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #ececec; vertical-align: top; }
table.extract th { width: 42%; color: #3a3a3a; font-weight: 600; background: #fafbfc; }

details.raw { margin-top: 20px; }
details.raw summary { cursor: pointer; color: var(--link-blue); font-size: 14px; }
details.raw pre {
  background: #1e2430;
  color: #dbe4f0;
  padding: 16px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.5;
}

.demo-note {
  background: #fff7ea;
  border: 1px solid #e8cf9f;
  border-left: 4px solid #d79a2b;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 13.5px;
  margin-bottom: 20px;
  color: #6b4a12;
}

/* ---- Category grid (Check status tab & categories) ----------------------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-right: none;
  border-bottom: none;
  margin-top: 8px;
}
.category-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 26px 14px 22px;
  text-align: center;
  background: #fff;
  cursor: pointer;
  transition: background .15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  min-height: 168px;
  color: inherit;
  text-decoration: none;
}
.category-cell:hover { background: #f6f9fd; text-decoration: none; }
.category-cell svg { height: 62px; width: auto; }
.category-cell span { font-size: 13px; text-transform: uppercase; letter-spacing: .02em; line-height: 1.35; }

.view-all { float: right; font-size: 14px; }

/* ---- Footer -------------------------------------------------------------- */

.site-footer {
  background: #2b2b2b;
  color: #cfcfcf;
  padding: 30px 20px;
  font-size: 13.5px;
}
.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer a { color: #9ec7ef; }

/* ---- Responsive ---------------------------------------------------------- */

@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; transform: none; margin-bottom: 40px; margin-top: 10px; }
  .hero { padding-bottom: 40px; }
  .lang-note { margin-bottom: 40px; }
  .steps { grid-template-columns: 1fr; }
  .result-cols { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 18px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-nav a.nav-link { padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
  .btn-login, .btn-signup { text-align: center; margin-top: 10px; }
  .hero h1 { font-size: 30px; }
  .how-title h2 { font-size: 22px; }
  .page-banner h1 { font-size: 25px; }
  .tabs { flex-wrap: wrap; }
}
