/* Sign-in (index.html) in the SEMIX style: design-mockups/office-shell (PR 1), SEMIX_STYLE.md §3, §5, §6.
   Colours only from tokens.css. Phone first; from 900 px the panel on the left and the form on the right. */

body.lg-page {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg-card);
  color: var(--fg-default);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.lg {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-card);
}

.lg-desk {
  display: none !important;
}

/* Outline icons 24 x 24, line 2 (SEMIX_STYLE §11) */
.lg-ic {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- the gradient with the watermark (§3) ---------- */

.lg-hero {
  position: relative;
  overflow: hidden;
  padding: 28px 24px 52px;
  color: var(--fg-on-fill);
  background: linear-gradient(165deg, var(--brand-mark) -55%, var(--brand) 30%, var(--brand-pressed) 72%);
}

/* The mark B: white, its «now» dot --accent; the watermark all white at 10 % */
.lg-mark {
  display: block;
}

.lg-mark-line {
  fill: none;
  stroke: var(--fg-on-fill);
  stroke-width: 66;
  stroke-linecap: round;
}

.lg-mark-ring {
  fill: none;
  stroke: var(--fg-on-fill);
  stroke-width: 28;
}

.lg-mark-fill {
  fill: var(--fg-on-fill);
}

.lg-mark-now {
  fill: var(--accent);
}

.lg-water {
  position: absolute;
  right: -60px;
  top: -40px;
  width: 250px;
  height: 250px;
  opacity: 0.1;
}

.lg-water .lg-mark-now {
  fill: var(--fg-on-fill);
}

.lg-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

/* The app icon: the mark on its own gradient tile */
.lg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--brand-mark), var(--brand) 55%, var(--brand-pressed));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--fg-default) 25%, transparent);
}

.lg-icon .lg-mark {
  width: 40px;
  height: 40px;
}

.lg-word {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--header-fg-muted);
}

.lg-head {
  position: relative;
  margin: 6px 0 0;
  font-size: 34px;
  line-height: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fg-on-fill);
}

/* ---------- the white card with the form ---------- */

.lg-card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: -22px;
  padding: 26px 20px 28px;
  border-radius: 22px 22px 0 0;
  background: var(--bg-card);
}

.lg-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: var(--fg-default);
}

.lg-form {
  display: flex;
  flex-direction: column;
}

.lg-form > * + * {
  margin-top: 16px;
}

.lg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lg-field label {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-secondary);
}

/* Fields: 56 on the phone, 48 on the site; border 1.5 --border-control, in focus 2 --brand (§5) */
.lg-input {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 6px 0 14px;
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: inset 0 0 0 1.5px var(--border-control);
  color: var(--fg-muted-field);
}

.lg-input:focus-within {
  box-shadow: inset 0 0 0 2px var(--brand);
}

.lg-input input {
  flex: 1;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  box-shadow: none;
  color: var(--fg-default);
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
}

.lg-input input::placeholder {
  color: var(--fg-muted-field);
  font-weight: 400;
  opacity: 1;
}

/* «Show» / «Hide» in the password field */
.lg-show {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--brand);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.lg-show .lg-show-off,
.lg-show[aria-pressed="true"] .lg-show-on {
  display: none;
}

.lg-show[aria-pressed="true"] .lg-show-off {
  display: block;
}

/* The error above the button (§5): the block shows only when js/login.js has written words
   into #errorMessage; the live region stays in place so the words are read out */
.lg-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-fg);
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
}

.lg-error:has(.lg-error-text:empty) {
  height: 0;
  margin-top: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}

.lg-form:has(.lg-error-text:not(:empty)) .lg-input {
  box-shadow: inset 0 0 0 2px var(--danger-border);
}

/* Buttons (§6): Sign in — accent across, Register — Secondary, plans — a link */
.lg-submit,
.lg-register {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border-radius: 12px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}

.lg-submit {
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 18px;
  font-weight: 800;
}

.lg-submit:disabled {
  cursor: default;
}

/* «Loading»: the three bars of .btn-loader (styles.css) instead of the words */
.lg-submit .btn-text {
  transition: opacity 0.15s;
}

.lg-submit.loading .btn-text {
  opacity: 0;
}

.lg-submit.loading .btn-loader {
  opacity: 1;
}

.lg-submit .btn-loader span {
  background: var(--on-accent);
}

.lg-register {
  min-height: 52px;
  padding: 0 18px;
  background: var(--bg-card);
  color: var(--fg-default);
  box-shadow: inset 0 0 0 1px var(--border-control);
  font-size: 17px;
  font-weight: 700;
}

.lg-plans {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--brand);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.lg-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 14px;
  color: var(--fg-secondary);
}

.lg-divider::before,
.lg-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* Keyboard focus */
.lg-submit:focus-visible,
.lg-register:focus-visible,
.lg-plans:focus-visible,
.lg-show:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

@media (hover: hover) {
  .lg-register:hover {
    background: var(--bg-subtle);
  }

  .lg-plans:hover {
    text-decoration: underline;
  }
}

/* ---------- desktop: from 900 px ---------- */

@media (min-width: 900px) {
  .lg-desk {
    display: block !important;
  }

  .lg-phone {
    display: none !important;
  }

  .lg {
    flex-direction: row;
  }

  .lg-hero {
    flex: 0 0 46%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px 72px;
  }

  .lg-water {
    width: 520px;
    height: 520px;
    right: -120px;
    top: -90px;
  }

  .lg-brand {
    gap: 20px;
  }

  .lg-icon {
    width: 88px;
    height: 88px;
    border-radius: 20px;
  }

  .lg-icon .lg-mark {
    width: 56px;
    height: 56px;
  }

  .lg-word {
    font-size: 44px;
    line-height: 50px;
    letter-spacing: 0.08em;
    color: var(--fg-on-fill);
  }

  .lg-card {
    flex: 1;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 48px 24px;
    border-radius: 0;
  }

  .lg-card > * {
    width: 400px;
    max-width: 100%;
  }

  .lg-card > .lg-plans {
    width: auto;
  }

  .lg-input {
    min-height: 48px;
  }

  .lg-input input {
    height: 40px;
    font-size: 15px;
  }
}
