/* CADdy-Hub login / landing — the CADdy-Bid landing (Bid: src/views/caddy-est/home.html + home.css) in Hub
   colors. The app's own header bar (.ch-header, styles.css) across the top, then Bid's layout: a hero
   ("Welcome to" + the wordmark, a line of copy, the sign-in button) beside the main product shot, and
   alternating sections of a bold heading, a paragraph and a screenshot. Bid's bold headings (not light),
   screenshots as raised rounded panels on the gray canvas. All color through palette.css tokens. */

/* ---- Header: .ch-header supplies the bar, the height and the filled square icon buttons ---- */
.login-header { padding: 0 var(--sp-5); }
.login-header__brand { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; }
.login-header__logo { height: 30px; width: auto; max-width: 100%; display: block; }

/* Options menu: the shared .ch-options__panel look; login.js opens it with .is-open (not .ch-hidden). */
.options-menu { display: none; }
.options-menu.is-open { display: block; }

/* ---- Unauthorized banner (?error=unauthorized), the shared danger alert, centered under the bar ---- */
#login-error {
  max-width: 1000px;
  margin: var(--sp-4) auto 0;
  font-size: var(--fs-body);
  font-weight: 600;
  text-align: center;
}

/* ---- Company sign-in modal ---- */
.login-modal { width: min(400px, 92vw); }
.login-modal .ch-modal__body { display: flex; flex-direction: column; gap: var(--sp-3); }
.login-modal .ch-field { margin: 0; }
#cl-error { margin: 0; }

/* ---- Hero (Bid: text column beside the main screenshot) ---- */
.hero {
  text-align: center;
  padding: var(--sp-7) var(--sp-5) var(--sp-6);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-4);
}
.hero-top { display: flex; gap: var(--sp-3); align-items: baseline; flex-wrap: wrap; justify-content: center; }
.hero-top h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 700; line-height: 1.1;
  letter-spacing: var(--ls-tight); color: var(--font-color);
}
.hero-logo-text {
  font-size: clamp(2.25rem, 4vw, 3.25rem); font-weight: 800; line-height: 1.05;
  letter-spacing: var(--ls-tight); color: var(--brand-text);
}
.hero-subtitle p {
  font-size: var(--fs-h4); font-weight: 400; line-height: 1.55;
  color: var(--secondary-color); max-width: 560px; margin: 0 auto;
}
.hero-cta { margin-top: var(--sp-2); }

/* ---- Alternating sections (Bid: top-image = row, ontop = stacked, alt = screenshot left) ---- */
section {
  display: flex; align-items: center; justify-content: center;
  gap: var(--sp-7); padding: var(--sp-8) 10%;
  flex-direction: row-reverse;
}
section.ontop { flex-direction: column; gap: var(--sp-5); text-align: center; }
section.top-image { flex-direction: row; align-items: center; padding-top: var(--sp-7); }

section .text, section .text-long { flex: 1; text-align: center; }
section .main-image, section .image, section .live-preview { display: flex; justify-content: center; width: 100%; flex: 1; }

.top-image > .hero { flex: 0.9; }
.top-image > .main-image { flex: 1.6; }
.alt > .text { flex: 0.9; }
.alt > .live-preview { flex: 1.6; }

section h2 {
  font-size: var(--fs-h1); font-weight: 700; line-height: 1.2;
  letter-spacing: var(--ls-tight); margin: 0 0 var(--sp-3); color: var(--brand-text);
}
section p { font-size: var(--fs-h5); color: var(--secondary-color); line-height: 1.65; max-width: 680px; margin: 0 auto; }
section.ontop .image { max-width: 1100px; }

/* ---- Screenshots: raised rounded panels (light src here; palette.css body.dark swaps each to its -dark.png) ---- */
.shot { width: 100%; }
.shot-img, .hero-video {
  display: block; width: 100%; height: auto; max-width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--panel-shadow-lg);
}
/* Text left, screenshot right (the Master BOM section), so it does not sit twice in a row on the left. */
section.alt--flip { flex-direction: row; }

/* ---- Hero video: the overview in the same raised panel as the screenshots, one Play/Pause control in its
   bottom-right corner. Playing: a small filled square. Paused (reduced motion, Save-Data, or the viewer paused
   it): a larger brand-blue round Play button, off the poster's centered logo. login.js sets .is-paused. ---- */
.shot--video { position: relative; }
.hero-video { aspect-ratio: 16 / 9; object-fit: cover; }
.hero-video__toggle {
  position: absolute; right: var(--sp-3); bottom: var(--sp-3);
  box-shadow: var(--panel-shadow);
}
.hero-video__toggle .hero-video__ico--play { display: none; }
.shot--video.is-paused .hero-video__toggle .hero-video__ico--play { display: block; }
.shot--video.is-paused .hero-video__toggle .hero-video__ico--pause { display: none; }
.shot--video.is-paused .hero-video__toggle {
  right: var(--sp-4); bottom: var(--sp-4);
  width: 56px; height: 56px; border-radius: var(--radius-pill);
  box-shadow: var(--panel-shadow-lg);
}
.shot--video.is-paused .hero-video__toggle svg { width: 26px; height: 26px; }

/* ---- Footer ---- */
.footer {
  padding: var(--sp-5) 10%;
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-3); flex-wrap: wrap;
  background: var(--header-bar-bg);
  border-top: 1px solid var(--header-bar-border);
}
/* The footer sits on the header gray, as Bid's does, so its text uses the tokens built for that gray:
   --rail-fg (the rail's labels, same surface) and --table-head-fg (the deep header blue in light, a light
   blue in dark). --secondary-color and --brand-text are tuned for the panels and fell to 3.9:1 here. */
.footer-left strong { color: var(--table-head-fg); font-weight: 800; }
.footer-left p { margin: var(--sp-1) 0 0; color: var(--rail-fg); font-size: var(--fs-small); }
.footer-right { color: var(--rail-fg); font-size: var(--fs-small); font-weight: 600; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--canvas); }
::-webkit-scrollbar-thumb { background: var(--scroll-color); border-radius: var(--radius-pill); border: 2px solid var(--canvas); }

/* ---- Responsive (Bid's two breakpoints: iPad landscape, iPad portrait) ---- */
@media (max-width: 1024px) {
  section { padding: var(--sp-7) 6%; gap: var(--sp-6); }
  section.top-image { flex-direction: column; align-items: center; }
  .top-image > .hero, .top-image > .main-image { flex: unset; width: 100%; }
  .alt > .text { flex: 1; }
  .alt > .live-preview { flex: 1.2; }
  .hero { padding: var(--sp-6) var(--sp-5) var(--sp-4); }
  section h2 { font-size: var(--fs-h2); }
}
@media (max-width: 768px) {
  section { flex-direction: column !important; padding: var(--sp-6) 5%; gap: var(--sp-5); }
  section .text, section .text-long, section .main-image, section .image, section .live-preview { flex: unset; width: 100%; }
  .hero { padding: var(--sp-5) var(--sp-3) var(--sp-3); }
  .hero-top { flex-direction: column; align-items: center; gap: var(--sp-1); }
  .hero-subtitle p, section p { font-size: var(--fs-body); }
}
/* Phone: the bar keeps Company sign-in, the theme toggle and Options; Login with Microsoft is the hero's
   big button right under it, so the bar's own Login steps aside rather than push the bar off the screen. */
@media (max-width: 480px) {
  .login-header { padding: 0 var(--sp-3); gap: var(--sp-2); }
  .login-header__logo { height: 24px; }
  .login-header__actions { gap: var(--sp-1); }
  .login-header__login { display: none; }
  .hero-video__toggle { width: 32px; height: 32px; right: var(--sp-2); bottom: var(--sp-2); border-radius: var(--radius-md); }
  .hero-video__toggle svg { width: 16px; height: 16px; }
  .shot--video.is-paused .hero-video__toggle { width: 44px; height: 44px; right: var(--sp-3); bottom: var(--sp-3); }
  .shot--video.is-paused .hero-video__toggle svg { width: 20px; height: 20px; }
  .footer { padding: var(--sp-5) 5%; }
}
