/* ==========================================================================
   EMALEE ENGINEERING — Design tokens
   Palette: deep navy/black steel, arc-weld gold, safety red, steel blue.
   Display type: Oswald (condensed, stamped-steel signage feel)
   Body type: Inter
   Utility/data type: JetBrains Mono (registration numbers, tags, stats)
   Signature: the "weld seam" — a stitched divider with a traveling arc-glow,
   used between sections and re-purposed as the registration wizard's
   step tracker (root -> hot -> fill -> cap pass naming).
   ========================================================================== */

:root {
  --navy-950: #060b14;
  --navy-900: #0a1424;
  --navy-800: #0f2038;
  --navy-700: #16304f;
  --steel-600: #4b5768;
  --steel-300: #a9b4c2;
  --gold-500: #e8a63b;
  --gold-300: #f5c572;
  --red-600: #c8102e;
  --blue-500: #1f6fb2;
  --white-100: #f6f7f6;

  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  --radius-sm: 4px;
  --radius-md: 10px;
}

body {
  background-color: var(--navy-950);
  color: var(--white-100);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Full-width layout ----------
   Bootstrap's .container caps out at a fixed max-width (1140px, 1320px, etc.)
   on large screens, which leaves large empty margins on the sides on desktop.
   Override so containers fill the viewport, with a comfortable side gutter
   instead of a hard max-width. */
.container {
  max-width: 100% !important;
  padding-left: clamp(1rem, 4vw, 3.5rem);
  padding-right: clamp(1rem, 4vw, 3.5rem);
}

h1, h2, h3, h4, .display-font {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 600;
}

.eyebrow {
  font-family: var(--font-mono);
  color: var(--gold-500);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

a { color: var(--gold-300); }
a:hover { color: var(--gold-500); }

/* ---------- Surfaces ---------- */
.bg-navy-950 { background-color: var(--navy-950); }
.bg-navy-900 { background-color: var(--navy-900); }
.bg-navy-800 { background-color: var(--navy-800); }

.panel {
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
  border: 1px solid rgba(232, 166, 59, 0.14);
  border-radius: var(--radius-md);
}

/* ---------- Buttons ---------- */
.btn-weld {
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
  color: var(--navy-950);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-weld:hover {
  color: var(--navy-950);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(232, 166, 59, 0.25);
}
.btn-weld-outline {
  background: transparent;
  color: var(--white-100);
  border: 1px solid var(--steel-300);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.72rem 1.7rem;
  border-radius: var(--radius-sm);
}
.btn-weld-outline:hover {
  color: var(--navy-950);
  background: var(--white-100);
  border-color: var(--white-100);
}

/* ---------- Navbar ---------- */
.navbar-emalee {
  background: rgba(6, 11, 20, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(232, 166, 59, 0.16);
}
.navbar-emalee .navbar-brand {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: var(--white-100);
  font-weight: 700;
}
.navbar-emalee .navbar-brand span { color: var(--gold-500); }
.navbar-emalee .nav-link {
  color: var(--steel-300);
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0.35rem;
}
.navbar-emalee .nav-link:hover,
.navbar-emalee .nav-link.active { color: var(--gold-500); }

.navbar-logo {
  height: 38px;
  width: 38px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

/* ---------- Mobile quick-access strip ---------- */
.nav-quick-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: var(--steel-300);
  font-size: 1.15rem;
  border: 1px solid rgba(232, 166, 59, 0.14);
  background: rgba(255, 255, 255, 0.02);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.nav-quick-link:hover,
.nav-quick-link.active {
  color: var(--gold-500);
  border-color: rgba(232, 166, 59, 0.4);
  background: rgba(232, 166, 59, 0.08);
}
.navbar-toggler {
  padding: 0.3rem 0.55rem;
  border-color: rgba(232, 166, 59, 0.25);
}
.navbar-toggler:focus { box-shadow: 0 0 0 0.2rem rgba(232, 166, 59, 0.25); }

/* ---------- Mobile sidebar (offcanvas) ---------- */
.navbar-offcanvas {
  background: var(--navy-950);
  border-left: 1px solid rgba(232, 166, 59, 0.16);
  width: min(320px, 84vw);
}
.navbar-offcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(232, 166, 59, 0.14);
  padding: 1.25rem 1.25rem 1rem;
}
.offcanvas-brand-text {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: var(--white-100);
  font-weight: 700;
  font-size: 1.05rem;
}
.offcanvas-brand-text span { color: var(--gold-500); }
.navbar-offcanvas .offcanvas-body { padding: 1.25rem; }
.offcanvas-nav .nav-item { margin-bottom: 0.15rem; }
.offcanvas-nav .nav-link {
  color: var(--steel-300);
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.7rem 0.6rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color .15s ease, background .15s ease;
}
.offcanvas-nav .nav-link:hover,
.offcanvas-nav .nav-link.active {
  color: var(--gold-500);
  background: rgba(232, 166, 59, 0.08);
}
.offcanvas-divider {
  border-color: rgba(232, 166, 59, 0.14);
  margin: 0.6rem 0;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  background:
    linear-gradient(180deg, rgba(6,11,20,0.55) 0%, rgba(6,11,20,0.85) 65%, var(--navy-950) 100%),
    radial-gradient(ellipse at 20% 20%, rgba(232,166,59,0.10), transparent 45%),
    var(--navy-950);
  overflow: hidden;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  color: var(--gold-500);
  letter-spacing: 0.22em;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.02;
}
.hero .lead-copy {
  color: var(--steel-300);
  max-width: 42rem;
  font-size: 1.1rem;
}

/* ---------- Weld seam divider (signature element) ---------- */
.weld-seam {
  position: relative;
  height: 34px;
  margin: 0 auto;
  width: 100%;
  overflow: hidden;
}
.weld-seam svg { width: 100%; height: 100%; display: block; }
.weld-seam .seam-line {
  stroke: var(--steel-600);
  stroke-width: 2;
  stroke-dasharray: 10 8;
}
.weld-seam .seam-glow {
  stroke: var(--gold-500);
  stroke-width: 3;
  stroke-dasharray: 46 900;
  filter: drop-shadow(0 0 6px rgba(232,166,59,0.9));
  animation: seam-travel 5.5s linear infinite;
}
@keyframes seam-travel {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -946; }
}
@media (prefers-reduced-motion: reduce) {
  .weld-seam .seam-glow { animation: none; }
}

/* ---------- Stat / value cards ---------- */
.stat-card { border-left: 3px solid var(--gold-500); padding: 1.25rem 1.5rem; }
.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  color: var(--gold-500);
}
.stat-card .stat-label {
  color: var(--steel-300);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Service card ---------- */
.service-card {
  background: var(--navy-800);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  height: 100%;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.service-card:hover { border-color: var(--gold-500); transform: translateY(-3px); }
.service-card .icon-badge {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(232,166,59,0.12);
  color: var(--gold-500);
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

/* ---------- Section eyebrow numbering (used only for real sequences) ---------- */
.stage-card {
  background: var(--navy-800);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 1.5rem;
  height: 100%;
}
.stage-number {
  font-family: var(--font-mono);
  color: var(--gold-500);
  font-size: 0.85rem;
}

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--navy-900);
  border-top: 1px solid rgba(232,166,59,0.14);
  color: var(--steel-300);
}
footer.site-footer h6 {
  font-family: var(--font-display);
  color: var(--white-100);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
footer.site-footer a { color: var(--steel-300); text-decoration: none; }
footer.site-footer a:hover { color: var(--gold-500); }

/* ---------- Registration wizard ---------- */
.wizard-tracker { display: flex; gap: 0.35rem; margin-bottom: 2rem; }
.wizard-tracker .pass {
  flex: 1;
  height: 6px;
  background: var(--navy-700);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.wizard-tracker .pass.done,
.wizard-tracker .pass.active {
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
}
.wizard-step-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--steel-300);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-control, .form-select {
  background-color: var(--navy-800);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--white-100);
}
.form-control:focus, .form-select:focus {
  background-color: var(--navy-800);
  color: var(--white-100);
  border-color: var(--gold-500);
  box-shadow: 0 0 0 0.2rem rgba(232,166,59,0.2);
}
.form-control::placeholder { color: var(--steel-600); }
label.form-label { color: var(--steel-300); font-size: 0.9rem; }

.badge-status { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Utility ---------- */
.text-gold { color: var(--gold-500); }
.text-steel { color: var(--steel-300); }
.section-py { padding-top: 5.5rem; padding-bottom: 5.5rem; }

@media (max-width: 767px) {
  .section-py { padding-top: 3.25rem; padding-bottom: 3.25rem; }
  .hero { min-height: auto; padding: 7rem 0 4rem; }
}

/* ---------- Upload progress ---------- */
.upload-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--navy-800);
  overflow: hidden;
  margin-top: 4px;
}
.upload-progress-bar {
  height: 100%;
  background: var(--gold-500);
  transition: width 0.15s ease;
}

/* ---------- Password visibility toggle ---------- */
.password-field { position: relative; }
.password-field .form-control { padding-right: 2.75rem; }
.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--steel-300);
  cursor: pointer;
}
.password-toggle:hover { color: var(--gold-500); }
.password-toggle:focus-visible { outline: 2px solid var(--gold-500); outline-offset: -2px; border-radius: 4px; }

/* ---------- Admin document thumbnails (application review) ---------- */
.doc-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--steel-700, #3a4048);
  background: var(--navy-900, #0f1620);
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.doc-thumb-btn:hover .doc-thumb,
.doc-thumb-btn:focus-visible .doc-thumb {
  border-color: var(--gold-500);
  transform: translateY(-2px);
}

/* ---------- Registration wizard: file upload preview ---------- */
.upload-preview {
  margin-top: .5rem;
  display: none;
}
.upload-preview.has-image {
  display: block;
}
.upload-preview img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 6px;
  border: 1px solid var(--steel-700, #3a4048);
  object-fit: cover;
}
.upload-preview .upload-preview-file {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--steel-300);
  font-size: .85rem;
}

/* --- Chat (apprentice <-> admin) --- */
.chat-window {
  height: 55vh;
  min-height: 320px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--navy-950);
  border: 1px solid var(--steel-600);
  border-radius: 10px;
}
.chat-bubble {
  max-width: 75%;
  padding: .55rem .85rem;
  border-radius: 12px;
  font-size: .9rem;
  line-height: 1.35;
}
.chat-bubble-mine {
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
  color: var(--navy-950);
  border-bottom-right-radius: 3px;
}
.chat-bubble-theirs {
  background: var(--navy-800);
  color: #fff;
  border: 1px solid var(--steel-600);
  border-bottom-left-radius: 3px;
}
.chat-bubble-sender {
  font-size: .72rem;
  font-weight: 600;
  color: var(--gold-300);
  margin-bottom: .15rem;
}
.chat-bubble-text { white-space: pre-wrap; word-break: break-word; }
.chat-bubble-time {
  font-size: .65rem;
  opacity: .65;
  margin-top: .25rem;
  text-align: right;
}
.chat-thread-row {
  cursor: pointer;
  border-bottom: 1px solid var(--steel-600);
  transition: background .15s ease;
}
.chat-thread-row:hover, .chat-thread-row.active {
  background: var(--navy-800);
}

/* Grouped bubbles (consecutive messages from the same sender) sit closer
   together than separate "turns" in the conversation. */
.chat-row-grouped { margin-top: .2rem; }
.chat-bubble-grouped .chat-bubble-sender { display: none; }

.chat-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy-800);
  border: 1px solid var(--steel-600);
  color: var(--gold-300);
  font-size: .68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-day-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--steel-300);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin: 1rem 0 .75rem;
}
.chat-day-divider::before,
.chat-day-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--steel-600);
}
.chat-day-divider span { padding: 0 .75rem; white-space: nowrap; }

/* ---------- Auth (login / register) ----------
   Own wrapper rather than .container, because the global .container rule
   above forces max-width: 100% !important and would stretch the card
   edge to edge. The card is centred and capped; on phones it keeps a
   comfortable side gutter. */
.auth-hero {
  min-height: 100vh;
  min-height: 100dvh;
  justify-content: center;
  align-items: center;
  padding: 7rem 1rem 3rem;
}
.auth-shell {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}
.auth-card {
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
@media (max-width: 767px) {
  .auth-hero { min-height: 100dvh; padding: 6rem 1rem 2rem; align-items: flex-start; }
}
