/* Palette lifted from the "Secure. Monitor. Protect." poster: deep navy
   chrome, white content, green and cyan accents, one signature colour per
   service. */
:root {
  --navy-900: #0a1628;
  --navy-800: #0d1f38;
  --navy-700: #12253f;
  --navy-600: #1c3455;
  --navy-500: #2f4a72;

  --green: #8cc63f;
  --green-dark: #6fa32c;
  --cyan: #29abe2;
  --cyan-dark: #1b8fc0;

  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #dde3ea;
  --text: #16202e;
  --muted: #64748b;

  --danger: #c0392b;
  --success: #2e7d32;
  --warning: #b45309;

  /* Service signature colours, matching the poster cards */
  --grafana: #f46800;
  --syslog: #1565c0;
  --cacti: #2e7d32;
  --backup: #6a3b9a;

  --radius: 8px;
  --shadow: 0 1px 3px rgba(10, 22, 40, .08), 0 1px 2px rgba(10, 22, 40, .04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--cyan-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 25px; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 30px 0 12px; }
.subtitle { color: var(--muted); margin: 0 0 24px; }

/* --- Top bar --- */
.topbar { background: var(--navy-900); color: #fff; border-bottom: 3px solid var(--green); }
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 26px; min-height: 60px; flex-wrap: wrap;
}
.brand { color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .dot-g { color: var(--green); }
.brand .dot-c { color: var(--cyan); }
.nav { display: flex; gap: 20px; }
.nav a { color: #b8c9dd; font-size: 14px; font-weight: 500; }
.nav a:hover { color: #fff; text-decoration: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; }
.org-name, .user-link { color: #b8c9dd; }
.user-link:hover { color: #fff; }
.org-switch select {
  background: var(--navy-600); color: #fff; border: 1px solid var(--navy-500);
  border-radius: var(--radius); padding: 6px 9px; font-size: 13px;
}
.btn-link {
  background: none; border: none; color: #b8c9dd; cursor: pointer;
  font: inherit; padding: 0; text-decoration: underline;
}
.btn-link:hover { color: #fff; }
.inline { display: inline; }

/* --- Layout --- */
.page { max-width: 1180px; width: 100%; margin: 0 auto; padding: 30px 20px; flex: 1; }
.narrow { max-width: 460px; width: 100%; margin: 0 auto; padding: 48px 20px; flex: 1; }
.full { width: 100%; flex: 1; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* --- Forms --- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.req { color: var(--danger); margin-left: 2px; }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=tel], .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font: inherit; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(41,171,226,.15);
}
.field input[type=checkbox] { width: auto; margin-right: 6px; }
.field-invalid input, .field-invalid select { border-color: var(--danger); }
.help { color: var(--muted); font-size: 13px; margin: 5px 0 0; }
.error { color: var(--danger); font-size: 13px; margin: 5px 0 0; }
.form-errors {
  background: #fdf1ef; border: 1px solid #f0c4bd; color: var(--danger);
  border-radius: var(--radius); padding: 11px 14px; margin-bottom: 18px;
}
.form-errors p { margin: 0; }

.btn {
  display: inline-block; background: var(--green); color: #10250a;
  border: 1px solid var(--green); padding: 10px 20px; border-radius: var(--radius);
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; text-decoration: none; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-cyan { background: var(--cyan); border-color: var(--cyan); color: #04202c; }
.btn-cyan:hover { background: var(--cyan-dark); border-color: var(--cyan-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); font-weight: 600; }
.btn-secondary:hover { background: #eef1f5; color: var(--text); }
.btn-danger { background: #fff; color: var(--danger); border-color: #e8bdb6; font-weight: 600; }
.btn-danger:hover { background: #fdf1ef; color: var(--danger); }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.actions { display: flex; gap: 12px; align-items: center; margin-top: 22px; flex-wrap: wrap; }

/* --- Messages --- */
.messages { list-style: none; padding: 0; margin: 0 0 20px; }
/* The landing page uses a full-bleed main, so messages need their own gutter. */
.full .messages, .full .banner { max-width: 1180px; margin: 20px auto; padding-left: 20px; padding-right: 20px; }
.msg { padding: 11px 15px; border-radius: var(--radius); margin-bottom: 10px; border: 1px solid; }
.msg-success { background: #eef8ec; border-color: #b7ddb0; color: var(--success); }
.msg-error   { background: #fdf1ef; border-color: #f0c4bd; color: var(--danger); }
.msg-warning { background: #fef6e7; border-color: #f0d9a8; color: var(--warning); }
.msg-info    { background: #e9f6fd; border-color: #b3e0f5; color: var(--cyan-dark); }

.banner {
  background: #fef6e7; border: 1px solid #f0d9a8; color: var(--warning);
  padding: 11px 15px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px;
}
.banner .btn-link { color: var(--warning); }

/* --- Tables --- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border);
              border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: 12px 15px; border-bottom: 1px solid var(--border); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
     font-weight: 700; background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }
.row-inactive { opacity: .5; }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 700; border: 1px solid;
}
.badge-owner    { background: #e9f6fd; border-color: #b3e0f5; color: var(--cyan-dark); }
.badge-admin    { background: #f1ecf9; border-color: #cfbde8; color: var(--backup); }
.badge-operator { background: #eef8ec; border-color: #b7ddb0; color: var(--success); }
.badge-viewer   { background: #f1f5f9; border-color: var(--border); color: var(--muted); }
.badge-inactive { background: #f1f5f9; border-color: var(--border); color: var(--muted); }

/* --- Dashboard tiles --- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  border-top: 3px solid var(--cyan);
}
.tile .value { font-size: 30px; font-weight: 700; line-height: 1.15; }
.tile .label { color: var(--muted); font-size: 13px; margin-top: 3px; }

.empty { color: var(--muted); padding: 24px; text-align: center; background: var(--surface);
         border: 1px dashed var(--border); border-radius: var(--radius); }

.footer {
  background: var(--navy-900); color: #8fa3ba; padding: 18px 20px;
  font-size: 13px; text-align: center;
}
.footer a { color: var(--cyan); }

/* --- Service cards (the four poster tools) --- */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 18px; }
.service {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.service-head { padding: 18px 20px 14px; border-top: 4px solid var(--accent, var(--cyan)); }
.service-name { font-size: 17px; font-weight: 700; color: var(--accent, var(--cyan)); }
.service-kind { font-size: 12px; color: var(--muted); text-transform: uppercase;
                letter-spacing: .05em; font-weight: 700; }
.service-body { padding: 0 20px 16px; flex: 1; }
.service-body p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.service-meta { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.service-meta li { display: flex; justify-content: space-between; padding: 5px 0;
                   border-bottom: 1px solid var(--border); }
.service-meta li:last-child { border-bottom: none; }
.service-meta .k { color: var(--muted); }
.service-meta .v { font-weight: 600; }
.service-foot { padding: 13px 20px; background: #f8fafc; border-top: 1px solid var(--border); }

.svc-grafana { --accent: var(--grafana); }
.svc-syslog  { --accent: var(--syslog); }
.svc-cacti   { --accent: var(--cacti); }
.svc-backup  { --accent: var(--backup); }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-running { background: var(--success); }
.status-stopped { background: var(--muted); }
.status-error   { background: var(--danger); }
.status-pending { background: var(--warning); }

/* --- Landing page --- */
.hero {
  background:
    radial-gradient(1100px 420px at 78% 12%, rgba(41,171,226,.20), transparent 62%),
    linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 100%);
  color: #fff;
}
.hero-inner {
  max-width: 1180px; margin: 0 auto; padding: 60px 20px 54px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
}
.hero h1 {
  font-size: 50px; line-height: 1.03; font-weight: 800;
  letter-spacing: -.02em; margin: 0 0 18px;
}
.hero h1 .w { color: #fff; display: block; }
.hero h1 .g { color: var(--green); display: block; }
.hero h1 .c { color: var(--cyan); display: block; }
.hero .lede { font-size: 19px; color: #cfdcea; margin: 0 0 26px; max-width: 30em; }

.pillars { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0; margin: 0; list-style: none; }
.pillars li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #cfdcea; }
.pillars .tick {
  width: 20px; height: 20px; border-radius: 50%; background: var(--green);
  color: var(--navy-900); font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}

.badge247 {
  display: inline-block; margin-top: 26px; background: var(--cyan);
  color: #04202c; font-weight: 800; padding: 7px 16px; border-radius: 20px;
  font-size: 13px; letter-spacing: .04em;
}

.login-panel {
  background: var(--surface); border-radius: 10px; padding: 28px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .32); color: var(--text);
}
.login-panel h2 { margin: 0 0 4px; font-size: 20px; }
.login-panel .sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

.section { max-width: 1180px; margin: 0 auto; padding: 54px 20px; }
.section-head { text-align: center; margin-bottom: 34px; }
.section-head h2 { font-size: 27px; margin: 0 0 8px; font-weight: 800; letter-spacing: -.01em; }
.section-head h2 .g { color: var(--green-dark); }
.section-head p { color: var(--muted); margin: 0; }
.section-alt { background: #eef2f7; }

.tool { border-top: 4px solid var(--accent, var(--cyan)); }
.tool h3 { margin: 0 0 2px; font-size: 18px; color: var(--accent, var(--cyan)); }
.tool .kind { font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
              color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.tool ul { list-style: none; padding: 0; margin: 12px 0 0; font-size: 14px; }
.tool ul li { padding: 5px 0 5px 22px; position: relative; color: #33445c; }
.tool ul li::before {
  content: "✓"; position: absolute; left: 0; color: var(--accent, var(--cyan)); font-weight: 800;
}

.benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 20px; }
.benefit { text-align: center; padding: 22px 16px; background: var(--surface);
           border: 1px solid var(--border); border-radius: var(--radius); }
.benefit h4 { margin: 0 0 6px; font-size: 14px; text-transform: uppercase;
              letter-spacing: .03em; color: var(--navy-700); }
.benefit p { margin: 0; font-size: 13px; color: var(--muted); }

.idealfor { background: var(--navy-900); color: #fff; }
.idealfor-inner {
  max-width: 1180px; margin: 0 auto; padding: 26px 20px;
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap; justify-content: center;
}
.idealfor .label { font-weight: 800; color: var(--green); letter-spacing: .06em; font-size: 14px; }
.idealfor .items { display: flex; flex-wrap: wrap; gap: 12px 26px; justify-content: center; }
.idealfor .items span { color: #cfdcea; font-size: 14px; }

.closing { background: var(--navy-800); color: #fff; }
.closing-inner {
  max-width: 1180px; margin: 0 auto; padding: 26px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.closing .trust { font-weight: 800; font-size: 17px; }
.closing .trust .g { color: var(--green); }
.closing a { color: var(--cyan); font-weight: 600; }

.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head h1 { font-size: 22px; }
.auth-links { margin-top: 18px; font-size: 14px; text-align: center; color: var(--muted); }

/* OTP entry */
.otp-input {
  letter-spacing: .55em; font-size: 26px; text-align: center; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 34px; padding: 44px 20px; }
  .hero h1 { font-size: 38px; }
}
@media (max-width: 640px) {
  .topbar-inner { gap: 12px; padding: 10px 16px; }
  .topbar-right { width: 100%; margin-left: 0; }
  th, td { padding: 10px; font-size: 14px; }
  .hero h1 { font-size: 32px; }
  .closing-inner { justify-content: center; text-align: center; }
}
