:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #607087;
  --line: #dfe6ef;
  --blue: #1c5d99;
  --teal: #0f8b8d;
  --green: #2d8a56;
  --amber: #b5771f;
  --shadow: 0 18px 44px rgba(18, 35, 61, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  overflow: hidden;
}

body.ifms-landing {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  overflow: hidden !important;
}

.ifms-landing a {
  color: inherit;
  text-decoration: none;
}

.ifms-landing button {
  border: 0;
}

.landing-header {
  flex: 0 0 auto;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 68px;
  padding: 12px clamp(18px, 5vw, 64px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.ifms-landing main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

.landing-notice {
  margin: 14px clamp(18px, 5vw, 64px) 0;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.landing-notice.success {
  border-color: #b9ddc9;
  background: #edf8f1;
  color: #1f6d41;
}

.landing-notice.error {
  border-color: #f1c6c6;
  background: #fff1f1;
  color: #9d2929;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
}

.brand-text {
  font-size: 18px;
}

.landing-nav {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 3vw, 34px);
  color: var(--muted);
  font-size: 14px;
}

.landing-nav button:hover,
.landing-footer a:hover {
  color: var(--blue);
}

.nav-tab {
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.nav-tab.is-active {
  color: var(--blue);
}

.ifms-landing .login-link,
.ifms-landing .primary-action,
.ifms-landing .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
}

.ifms-landing .login-link,
.ifms-landing .primary-action {
  background: var(--blue);
  color: #fff;
}

.ifms-landing .login-link:hover,
.ifms-landing .primary-action:hover {
  background: #174d80;
  color: #fff;
}

.ifms-landing .secondary-action {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.ifms-landing .secondary-action:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  min-height: 0;
  padding: 18px clamp(18px, 5vw, 64px) 26px;
}

.hero-copy {
  max-width: 660px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 590px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.38;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.system-preview {
  overflow: hidden;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.preview-toolbar {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.preview-toolbar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--line);
}

.preview-toolbar span:nth-child(1) {
  background: var(--blue);
}

.preview-toolbar span:nth-child(2) {
  background: var(--teal);
}

.preview-toolbar span:nth-child(3) {
  background: var(--amber);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 14px 18px;
}

.preview-metric,
.preview-chart,
.preview-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.preview-metric {
  min-height: 62px;
  padding: 12px 14px;
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.preview-metric strong {
  font-size: 22px;
}

.preview-chart {
  grid-column: span 2;
  display: flex;
  align-items: end;
  gap: 18px;
  min-height: 132px;
  padding: 16px;
}

.bar {
  flex: 1;
  min-width: 28px;
  border-radius: 8px 8px 0 0;
  background: var(--blue);
}

.bar-a {
  height: 38%;
}

.bar-b {
  height: 68%;
  background: var(--teal);
}

.bar-c {
  height: 52%;
  background: var(--green);
}

.bar-d {
  height: 82%;
}

.bar-e {
  height: 61%;
  background: var(--amber);
}

.preview-table {
  display: grid;
  align-content: center;
  gap: 14px;
  min-height: 132px;
  padding: 16px;
}

.preview-table span {
  height: 14px;
  border-radius: 7px;
  background: var(--line);
}

.preview-table span:nth-child(2) {
  width: 76%;
}

.preview-table span:nth-child(3) {
  width: 88%;
}

.preview-table span:nth-child(4) {
  width: 62%;
}

.page-preview-section {
  padding: 22px clamp(18px, 5vw, 64px) 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  scroll-margin-top: 0;
}

.landing-page-panel {
  display: none;
}

.landing-page-panel.is-active {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(24px, 5vw, 64px);
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.08;
}

.landing-page-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.module-card {
  min-height: 154px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.module-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #e9f3fb;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.module-card h3 {
  margin: 14px 0 8px;
  font-size: 17px;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.security-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.security-list span {
  min-height: 58px;
  padding: 18px;
  border-left: 4px solid var(--teal);
  background: #f7fafc;
  color: var(--ink);
  font-weight: 700;
}

.login-panel.is-active {
  align-items: start;
}

.landing-login-form {
  display: grid;
  width: min(100%, 420px);
  gap: 8px;
  padding: 16px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.landing-login-form label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.landing-login-form input {
  width: 100%;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #b9c9da;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.landing-login-form input:focus {
  outline: 3px solid rgba(28, 93, 153, 0.18);
  border-color: var(--blue);
}

.landing-login-form button {
  min-height: 40px;
  margin-top: 8px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.landing-login-form button:hover {
  background: #174d80;
}

.landing-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  min-height: 53px;
  padding: 16px clamp(18px, 5vw, 64px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.landing-footer button {
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.landing-footer button:hover {
  color: var(--blue);
}

@media (max-width: 980px) {
  .landing-header {
    grid-template-columns: 1fr auto;
  }

  .landing-nav {
    display: none;
  }

  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .system-preview {
    min-height: 300px;
  }

  .module-grid,
  .security-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .landing-header {
    padding-inline: 14px;
  }

  .brand-text {
    font-size: 16px;
  }

  .login-link {
    min-height: 38px;
    padding-inline: 14px;
  }

  .hero-section {
    padding: 22px 14px;
  }

  .hero-lede {
    font-size: 17px;
  }

  .hero-actions a {
    width: 100%;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .preview-chart,
  .preview-table {
    grid-column: auto;
    min-height: 180px;
  }

  .page-preview-section,
  .landing-page-panel.is-active {
    grid-template-columns: 1fr;
    padding-inline: 14px;
  }

  .module-grid,
  .security-list {
    grid-template-columns: 1fr;
  }

  .landing-footer {
    flex-direction: column;
    padding-inline: 14px;
  }
}
