/*
 * Sign-in screens (layouts/login): the road scene behind, Speedy over a white card, and the
 * card's fields, tabs, buttons and banners. Scoped to .lg-page, so nothing here reaches the
 * application layouts. Night is the default; login/sign_in.js sets html[data-daypart=day].
 */
.lg-page {
  --lg-navy: #20456B;
  --lg-deep: #0C2A48;
  --lg-ink: #071437;
  --lg-sub: #4B5675;
  --lg-label: #252F4A;
  --lg-line: #E4E8EF;
  --lg-fill: #EEF2F7;
  --lg-amber: #E59B30;
  --lg-ring: 0 0 0 4px rgba(32, 69, 107, .25);
  --lg-err: #C62828;
  --lg-err-bg: #FFF5F5;
  --lg-err-ring: 0 0 0 4px rgba(198, 40, 40, .18);
  margin: 0;
  /* Metronic makes body a flex box at full height, which squeezes .lg-main to the screen and
     cuts off the bottom of a tall card. A block body grows with its content and scrolls. */
  display: block;
  height: auto;
  min-height: 100vh;
  background: var(--lg-deep);
  font-family: Rubik, system-ui, sans-serif;
  color: var(--lg-ink);
}

/* ---- scene ---- */
.lg-scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.lg-scene .lg-day { display: none; }
.lg-scene .lg-clouds { opacity: .07; }
html[data-daypart="day"] .lg-scene .lg-clouds { opacity: .22; }
html[data-daypart="day"] .lg-page { background: #1F5A93; }
html[data-daypart="day"] .lg-scene .lg-day { display: inline; }
.lg-sun {
  display: none;
  position: fixed;
  z-index: 0;
  top: clamp(8px, 7vh, 72px);
  right: clamp(8px, 9vw, 150px);
  width: clamp(56px, 15vmin, 190px);
  height: auto;
}
html[data-daypart="day"] .lg-sun { display: block; }
html[data-daypart="day"] .lg-scene .lg-night,
html[data-daypart="day"] .lg-scene .lg-beam { display: none; }

/* ---- frame ---- */
.lg-main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh; /* phones: the height left after the browser's own bars */
  box-sizing: border-box;
  display: flex;
  padding: 24px 16px;
}
/* margin:auto centres the card, and unlike align-items:center it never pushes a card taller
   than the screen above the top edge, where it cannot be scrolled to. */
.lg-host { position: relative; width: 100%; max-width: 440px; margin: auto; }
.lg-speedy {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  width: 120px;
  height: 120px;
  margin-left: -60px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lg-card {
  position: relative;
  z-index: 1;
  margin-top: 64px;
  box-sizing: border-box;
  padding: 72px 40px 36px;
  border-radius: 20px;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 24px 60px rgba(0, 0, 0, .32);
  display: flex;
  flex-direction: column;
}
@media (max-width: 480px) {
  .lg-card { padding: 68px 20px 28px; }
}

/* ---- brand, titles ---- */
.lg-greeting { margin: 0 0 6px; min-height: 22px; text-align: center; font-size: 15px; font-weight: 500; color: var(--lg-sub); }
.lg-greeting:empty { display: none; }
.lg-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 24px; }
.lg-logo { width: 124px; height: auto; }
.lg-tagline { margin: 0; font-size: 14px; color: var(--lg-sub); }
.lg-head { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 24px; text-align: center; }
.lg-title { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.3; color: var(--lg-ink); }
.lg-text { margin: 0; font-size: 15px; line-height: 1.5; color: var(--lg-sub); }
.lg-masked { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: .06em; color: var(--lg-ink); }
.lg-head-icon { font-size: 56px; color: var(--lg-amber); }
.lg-hint { margin: 0 0 18px; font-size: 14px; line-height: 1.5; color: var(--lg-sub); }
.lg-note { margin: 0; font-size: 13px; color: var(--lg-sub); }

/* ---- tabs ---- */
.lg-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 24px; border-bottom: 1px solid var(--lg-line); }
.lg-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  font-size: 16px;
  font-weight: 500;
  color: var(--lg-sub);
  text-decoration: none;
}
.lg-tab:hover { color: var(--lg-ink); }
.lg-tab[aria-selected="true"] { border-bottom-color: var(--lg-amber); font-weight: 600; color: var(--lg-ink); }
.lg-tab:focus-visible { outline: none; box-shadow: var(--lg-ring); border-radius: 8px 8px 0 0; }

/* ---- fields ---- */
.lg-form { display: flex; flex-direction: column; }
.lg-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.lg-label { font-size: 14px; font-weight: 500; color: var(--lg-label); }
.lg-control {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  box-sizing: border-box;
  padding: 0 14px;
  border: 1.5px solid var(--lg-fill);
  border-radius: 12px;
  background: var(--lg-fill);
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.lg-control > i { flex: none; font-size: 20px; color: var(--lg-sub); }
.lg-control input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  color: var(--lg-ink);
  text-align: right;
}
.lg-control:focus-within { background: #FFFFFF; border-color: var(--lg-navy); box-shadow: var(--lg-ring); }
.lg-control:focus-within > i { color: var(--lg-navy); }
.lg-control.lg-invalid { background: var(--lg-err-bg); border-color: var(--lg-err); }
.lg-control.lg-invalid > i { color: var(--lg-err); }
.lg-control.lg-invalid:focus-within { box-shadow: var(--lg-err-ring); }
.lg-eye {
  flex: none;
  width: 44px;
  height: 44px;
  margin-left: -10px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--lg-sub);
}
.lg-eye i { font-size: 20px; }
.lg-eye.is-on, .lg-eye:hover { color: var(--lg-navy); }
.lg-eye:focus-visible { outline: none; box-shadow: var(--lg-ring); }
.lg-forgot { display: flex; justify-content: flex-end; margin: -8px 0 20px; }
.lg-link { padding: 4px 0; font-size: 14px; font-weight: 500; color: var(--lg-navy); text-decoration: none; }
.lg-link:hover { text-decoration: underline; color: var(--lg-navy); }

/* password meter (renew_pass): KTPasswordMeter marks the bars .active */
.lg-meter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding-top: 2px; }
.lg-meter > div { height: 4px; border-radius: 2px; background: #DCE3EC; }
.lg-meter > div.active { background: var(--lg-navy); }

/* one-time code (twofact): the boxes stay left to right */
.lg-otp { direction: ltr; display: flex; justify-content: center; gap: 10px; }
.lg-otp-box {
  flex: 1;
  min-width: 0;
  max-width: 60px;
  height: 60px;
  box-sizing: border-box;
  padding: 0;
  border: 1.5px solid var(--lg-fill);
  border-radius: 12px;
  background: var(--lg-fill);
  outline: none;
  text-align: center;
  font-family: inherit;
  font-size: 24px;
  font-weight: 600;
  color: var(--lg-ink);
}
.lg-otp-box:focus { background: #FFFFFF; border-color: var(--lg-navy); box-shadow: var(--lg-ring); }

/* ---- buttons ---- */
.lg-page .btn.lg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--lg-navy);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 600;
}
.lg-page .btn.lg-btn:hover, .lg-page .btn.lg-btn:focus { background: #183654; color: #FFFFFF; }
.lg-page .btn.lg-btn:focus-visible { box-shadow: var(--lg-ring); }
/* Needs Metronic's btn-outline class too: without it .btn:not(.btn-outline)... zeroes the border. */
.lg-page .btn.lg-btn-outline { border: 1.5px solid var(--lg-navy); background: transparent; color: var(--lg-navy); }
.lg-page .btn.lg-btn-outline:hover, .lg-page .btn.lg-btn-outline:focus { background: #EAF3FC; color: var(--lg-navy); }
.lg-page .btn.lg-btn-ghost { height: 48px; margin-top: 10px; background: transparent; color: var(--lg-navy); font-weight: 500; }
.lg-page .btn.lg-btn-ghost:hover, .lg-page .btn.lg-btn-ghost:focus { background: #EAF3FC; color: var(--lg-navy); }
.lg-page .btn.lg-btn i { font-size: 20px; color: inherit; }
.lg-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; font-size: 13px; color: var(--lg-sub); }
.lg-or::before, .lg-or::after { content: ""; flex: 1; height: 1px; background: var(--lg-line); }

/* ---- company choice (driver_company) ---- */
.lg-choices { display: flex; flex-direction: column; gap: 10px; }
.lg-choice-form { margin: 0; }
.lg-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 64px;
  padding: 0 14px;
  border: 1.5px solid var(--lg-line);
  border-radius: 14px;
  background: #FFFFFF;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--lg-ink);
  text-align: right;
  cursor: pointer;
}
.lg-choice:hover, .lg-choice:focus-visible { border-color: var(--lg-navy); outline: none; box-shadow: var(--lg-ring); }
.lg-choice-chip { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--lg-fill); display: flex; align-items: center; justify-content: center; }
.lg-choice-chip i { font-size: 20px; color: var(--lg-navy); }
.lg-choice-name { flex: 1; }
.lg-choice-go { font-size: 18px; color: var(--lg-sub); }

/* ---- banners ---- */
.lg-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}
.lg-banner i { flex: none; margin-top: 1px; font-size: 20px; }
.lg-banner span { flex: 1; }
.lg-banner-error { background: #FDECEC; border-color: #F6C9C9; color: #8E1B1B; }
.lg-banner-error i { color: var(--lg-err); }
.lg-banner-info { background: #EAF3FC; border-color: #C9DDF2; color: #163A5C; }
.lg-banner-info i { color: var(--lg-navy); }

/* ---- small screens: last, so they win over the base rules above ---- */
/* Short screens (laptops, phones in landscape): a smaller Speedy and tighter spacing keep the
   whole card in view. */
@media (max-height: 760px) {
  .lg-main { padding-top: 12px; padding-bottom: 12px; }
  .lg-speedy { width: 92px; height: 92px; margin-left: -46px; }
  .lg-speedy svg { width: 72px; height: 72px; }
  .lg-card { margin-top: 46px; padding-top: 54px; padding-bottom: 24px; }
  .lg-brand { margin-bottom: 14px; }
  .lg-tabs { margin-bottom: 14px; }
  .lg-field { margin-bottom: 12px; gap: 6px; }
  .lg-control { height: 46px; }
  .lg-forgot { margin: -4px 0 14px; }
  .lg-page .btn.lg-btn { height: 48px; }
  .lg-head { margin-bottom: 14px; }
}
/* Phones and very short windows: the whole card still fits without scrolling. */
@media (max-height: 680px) {
  .lg-main { padding-top: 8px; padding-bottom: 8px; }
  .lg-speedy { width: 76px; height: 76px; margin-left: -38px; }
  .lg-speedy svg { width: 60px; height: 60px; }
  .lg-card { margin-top: 38px; padding-top: 44px; padding-bottom: 18px; }
  .lg-greeting { margin-bottom: 2px; min-height: 0; font-size: 14px; }
  .lg-logo { width: 104px; }
  .lg-tagline { display: none; }
  .lg-brand { margin-bottom: 10px; }
  .lg-tab { height: 42px; font-size: 15px; }
  .lg-tabs { margin-bottom: 12px; }
  .lg-hint { margin-bottom: 10px; font-size: 13px; }
  .lg-label { font-size: 13px; }
  .lg-field { margin-bottom: 10px; gap: 4px; }
  .lg-control { height: 44px; }
  .lg-forgot { margin: -2px 0 10px; }
  .lg-page .btn.lg-btn { height: 46px; }
  .lg-or { margin: 12px 0; }
  .lg-head { margin-bottom: 10px; gap: 4px; }
  .lg-title { font-size: 20px; }
}
