/*
 * Application-wide styles (Propshaft). Tailwind utilities live in builds/tailwind.css.
 *
 * Layout rule for new pages:
 *   Wrap page content in <div class="lm-page"> (full width).
 *   Use <div class="lm-page lm-page--form"> only for short forms.
 *   Do NOT add max-w-xl / max-w-2xl / max-w-3xl on page roots.
 */

:root {
  --lm-ink: #14231c;
  --lm-forest: #0f3d2e;
  --lm-moss: #1f6b4a;
  --lm-sand: #eef4ef;
  --lm-glow: #d8ebe0;
  --lm-page-pad-x: 0.75rem;
  --lm-page-pad-y: 0.75rem;
  --lm-bottom-nav-h: 3.75rem;
}

@media (min-width: 640px) {
  :root {
    --lm-page-pad-x: 1.25rem;
    --lm-page-pad-y: 1rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --lm-page-pad-x: 1.5rem;
    --lm-page-pad-y: 1.25rem;
  }
}

.lm-body {
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  color: var(--lm-ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, var(--lm-glow), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, #f4f7f2, transparent 50%),
    linear-gradient(180deg, #f7faf8 0%, #eef3f0 100%);
}

.font-display,
.lm-topbar .font-display {
  font-family: "DM Sans", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
}

.lm-shell a {
  text-decoration: none;
}

.lm-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.lm-shell-main {
  width: 100%;
  flex: 1;
  padding: var(--lm-page-pad-y) var(--lm-page-pad-x);
  padding-bottom: calc(var(--lm-page-pad-y) + var(--lm-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  .lm-shell-main {
    padding-bottom: var(--lm-page-pad-y);
  }
}

/* Full-bleed page canvas — use on every authenticated page root */
.lm-page {
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .lm-page {
    gap: 1.25rem;
  }
}

/* Optional slightly narrower column for login-like forms inside the app */
.lm-page--form {
  max-width: 42rem;
}

.lm-page--split {
  display: grid;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .lm-page--split {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: start;
    gap: 1.25rem;
  }
}

.lm-dense-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .lm-dense-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lm-dense-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1280px) {
  .lm-dense-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.lm-panel {
  border: 1px solid rgba(15, 61, 46, 0.12);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
}

@media (min-width: 768px) {
  .lm-panel {
    padding: 1rem 1.15rem;
  }
}

/* Sticky mobile tab bar — live-app feel */
.lm-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.15rem;
  height: calc(var(--lm-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  background: rgba(15, 61, 46, 0.97);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

@media (min-width: 768px) {
  .lm-bottom-nav {
    display: none;
  }
}

.lm-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  border-radius: 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(220, 240, 230, 0.72);
  padding: 0.25rem;
}

.lm-bottom-nav a:hover,
.lm-bottom-nav a.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.lm-bottom-nav .lm-nav-ico {
  font-size: 1rem;
  line-height: 1;
}

/* Guest / login */
.lm-login {
  width: 100%;
  max-width: 22rem;
  margin: 0 auto;
  text-align: center;
}

.lm-login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.lm-login-logo {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 0 3px #0b0b0b,
    0 12px 28px rgba(15, 61, 46, 0.22);
}

.lm-login h1 {
  font-family: "DM Sans", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--lm-ink);
  margin: 0;
}

.lm-login-lead {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: #5b6b62;
}

.lm-login-form {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.9rem;
  text-align: left;
}

.lm-login-form input[type="email"],
.lm-login-form input[type="password"],
.lm-login-form input[type="text"] {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #c9d5ce;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 35, 28, 0.04);
  font: inherit;
  color: var(--lm-ink);
}

.lm-login-form input:focus {
  outline: 2px solid var(--lm-moss);
  outline-offset: 1px;
  border-color: var(--lm-moss);
}

.lm-login-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
  margin-top: 0.15rem;
}

.lm-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.7rem 1.25rem;
  font: inherit;
  font-weight: 600;
  color: #fff !important;
  background: var(--lm-forest);
  box-shadow: 0 2px 8px rgba(15, 61, 46, 0.28);
}

.lm-btn-primary:hover {
  background: var(--lm-moss);
}

.lm-login-actions a {
  font-size: 0.875rem;
  color: #4a5c53;
  text-decoration: underline;
}

.lm-login-flash {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.lm-login-flash-alert {
  background: #fef2f2;
  color: #dc2626;
}

.lm-login-flash-notice {
  background: #ecfdf5;
  color: #059669;
}
