/* ==========================================================================
   EarlyPusher: home page and login page. The look follows the landing page of EarlyRepair (er-landing.css):
   navy sticky header, light page background, purple call-to-action buttons, Roboto.
   ========================================================================== */

*, *:before, *:after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background-color: #f4f9f8;
  color: #1c2b3a;
  font-family: 'Roboto', -apple-system, 'Segoe UI', Arial, sans-serif;
  line-height: 1.55;
}

h1, h2, h3, p, ul { margin-top: 0; }
a { color: #3d4fb5; }
code { background: rgba(61, 79, 181, 0.1); padding: 1px 6px; border-radius: 4px; font-size: 0.92em; }

/* ---------- announcement bar ---------- */
.announcement-bar {
  background-color: #f4f9f8;
  color: #1d4974;
  text-align: center;
  padding: 10px 12px;
  font-size: 0.8rem;
  word-break: break-word;
}

/* ---------- sticky header ---------- */
header.floating-pill {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: 64px;
  padding: 0 0 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 12, 63, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.header-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.header-logo img { height: 38px; width: auto; display: block; }
.header-logo .logo-text {
  font-weight: 900;
  font-style: italic;
  font-size: 1.7rem;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 1px 1px 0 #a8abad, 2px 2px 0 #9ea0a5, 3px 3px 0 #838a92, 4px 4px 0 rgba(0, 0, 0, 0.15);
}

ul.top-menu { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
ul.top-menu a {
  display: block;
  padding: 8px 14px;
  color: #dfe3ff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  border-radius: 6px;
}
ul.top-menu a:hover { background: rgba(255, 255, 255, 0.12); color: #ffffff; }

.header-actions { display: flex; align-items: center; height: 64px; }
.user-chip { color: #dfe3ff; font-size: 0.9rem; padding: 0 16px; white-space: nowrap; }
a.login-btn-full {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  padding: 0 28px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
  transition: background-color 0.2s ease;
}
a.login-btn-full:hover { background-color: rgba(255, 255, 255, 0.2); }

/* ---------- layout ---------- */
.main-wrapper { max-width: 1180px; margin: 0 auto; padding: 0 20px 40px; }
.section { padding: 64px 0 24px; }

.badge-subtitle {
  display: inline-block;
  padding: 5px 14px;
  margin-bottom: 14px;
  background: rgba(107, 43, 101, 0.1);
  color: #6b2b65;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
}
.badge-light { background: rgba(255, 255, 255, 0.14); color: #f0e4ff; }

/* ---------- hero ---------- */
.hero-title-section { text-align: center; max-width: 860px; margin: 0 auto; padding: 72px 0 36px; }
.hero-title-section h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1.15; font-weight: 900; color: #14153f; margin-bottom: 18px; }
.hero-title-section p { font-size: 1.1rem; color: #4a5a6b; margin-bottom: 28px; }
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 26px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: #6b2b65; color: #ffffff; }
.btn-primary:hover { background: #83357c; }
.btn-primary:disabled { background: #a98ba5; cursor: default; }
.btn-secondary { background: #ffffff; color: #14153f; border: 1px solid #c9d3dc; }
.btn-secondary:hover { background: #eef3f6; }
.btn-block { width: 100%; }

/* ---------- facts ---------- */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 8px; }
.fact { background: #ffffff; border: 1px solid #dde6ec; border-radius: 12px; padding: 18px 16px; text-align: center; }
.fact b { display: block; font-size: 1.25rem; color: #14153f; }
.fact span { font-size: 0.85rem; color: #5b6b7b; }

/* ---------- section titles ---------- */
.section-title { text-align: center; max-width: 760px; margin: 0 auto 36px; }
.section-title h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900; color: #14153f; margin-bottom: 12px; }
.section-title h2.light { color: #ffffff; }
.section-title p { color: #4a5a6b; }

/* ---------- feature cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: #ffffff; border: 1px solid #dde6ec; border-radius: 14px; padding: 24px 22px; box-shadow: 0 2px 10px rgba(20, 21, 63, 0.04); }
.card h3 { font-size: 1.1rem; color: #14153f; margin-bottom: 8px; }
.card p { margin-bottom: 0; color: #4a5a6b; font-size: 0.95rem; }
.card-icon { font-size: 1.7rem; margin-bottom: 10px; }

/* ---------- how it works (dark) ---------- */
.section-dark {
  margin: 56px -20px 0;
  padding: 64px 20px;
  background: linear-gradient(135deg, #0d0c3f 0%, #251a63 100%);
  border-radius: 18px;
}
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 1040px; margin: 0 auto; }
.step { background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 14px; padding: 24px 22px; color: #e6e9ff; }
.step h3 { color: #ffffff; margin-bottom: 8px; }
.step p { margin-bottom: 0; font-size: 0.95rem; }
.step code { background: rgba(255, 255, 255, 0.14); color: #ffffff; word-break: break-all; }
.step-no {
  width: 34px; height: 34px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  background: #6b2b65; color: #ffffff; font-weight: 900; border-radius: 50%;
}

/* ---------- code samples ---------- */
.code-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.code-box { background: #14153f; border-radius: 14px; padding: 20px 22px; overflow: hidden; }
.code-box h3 { color: #ffffff; font-size: 1rem; margin-bottom: 10px; }
.code-box pre {
  margin: 0; overflow-x: auto;
  color: #cfd6ff;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 0.86rem; line-height: 1.5;
}

/* ---------- limits ---------- */
.section-light { padding-bottom: 40px; }
.limits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.limit-box { background: #ffffff; border: 1px solid #dde6ec; border-radius: 14px; padding: 22px 24px; }
.limit-box h3 { color: #14153f; font-size: 1.1rem; }
.limit-box ul { padding-left: 20px; margin-bottom: 0; color: #4a5a6b; font-size: 0.95rem; }
.limit-box li { margin-bottom: 6px; }

/* ---------- footer ---------- */
.site-footer { background: #0d0c3f; color: #b9bfe8; font-size: 0.85rem; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 22px 20px; display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.site-footer a { color: #dfe3ff; }

/* ---------- login page ---------- */
.login-body { background: linear-gradient(160deg, #f4f9f8 0%, #e9e6f7 100%); min-height: 100vh; }
.login-wrap { display: flex; justify-content: center; padding: 56px 20px; }
.login-card { width: 100%; max-width: 440px; background: #ffffff; border: 1px solid #dde6ec; border-radius: 16px; padding: 32px 30px; box-shadow: 0 10px 30px rgba(20, 21, 63, 0.08); }
.login-intro h1 { font-size: 1.6rem; font-weight: 900; color: #14153f; margin-bottom: 8px; }
.login-intro p { color: #5b6b7b; font-size: 0.95rem; }
.login-form label { display: block; margin: 16px 0 6px; font-weight: 500; font-size: 0.88rem; color: #33475b; }
.login-form input {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid #c4d0da; border-radius: 8px;
  font-size: 1rem; font-family: inherit; background: #fbfdfd;
}
.login-form input:focus { outline: 2px solid rgba(107, 43, 101, 0.35); border-color: #6b2b65; }
.login-message { display: none; margin: 16px 0 0; padding: 10px 12px; border-radius: 8px; background: #fdecec; color: #a12525; font-size: 0.9rem; }
.login-form .btn { margin-top: 22px; }
.login-note { margin: 22px 0 0; text-align: center; font-size: 0.85rem; color: #6a7a8a; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  ul.top-menu { display: none; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .card-grid, .steps, .code-grid, .limits { grid-template-columns: 1fr; }
  .section-dark { margin-left: -20px; margin-right: -20px; border-radius: 0; }
  header.floating-pill { padding-left: 16px; }
  .header-logo .logo-text { font-size: 1.35rem; }
  .user-chip { display: none; }
}

/* ---------- /Home: the Pusher channels ---------- */
[hidden] { display: none !important; }

.console-wrap { max-width: 1100px; margin: 0 auto; padding: 36px 20px 56px; }
.console-head { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.console-head h1 { font-size: 1.9rem; font-weight: 900; color: #14153f; margin-bottom: 6px; }
.console-head p { margin: 0; max-width: 680px; color: #4a5a6b; }

.console-card { background: #ffffff; border: 1px solid #dde6ec; border-radius: 14px; padding: 22px 24px; margin-bottom: 18px; box-shadow: 0 2px 10px rgba(20, 21, 63, 0.04); }
.console-card h2 { font-size: 1.15rem; color: #14153f; margin-bottom: 6px; }
.console-card.created { border-color: #b9dfc9; background: #f6fcf8; }
.console-alert { margin-bottom: 18px; padding: 12px 14px; border-radius: 10px; background: #fdecec; color: #a12525; }

.muted { color: #6a7a8a; }
.small { font-size: 0.82rem; }
.right { text-align: right; }

.console-form { max-width: 520px; }
.console-form label { display: block; margin: 14px 0 6px; font-weight: 500; font-size: 0.88rem; color: #33475b; }
.console-form input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #c4d0da; border-radius: 8px; font-size: 1rem; font-family: inherit; }
.console-form input:focus { outline: 2px solid rgba(107, 43, 101, 0.35); border-color: #6b2b65; }
.form-buttons { display: flex; gap: 10px; margin-top: 18px; }

dl.cred { display: grid; grid-template-columns: 90px 1fr; gap: 8px 14px; margin: 14px 0 18px; }
dl.cred dt { font-weight: 700; color: #33475b; }
dl.cred dd { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
dl.cred code { font-size: 0.95rem; word-break: break-all; }

button.copy { height: 26px; padding: 0 10px; border: 1px solid #c4d0da; border-radius: 6px; background: #ffffff; color: #33475b; font-size: 0.78rem; font-family: inherit; cursor: pointer; }
button.copy:hover { background: #eef3f6; }
.btn-danger { height: 30px; padding: 0 12px; border: 1px solid #e3b4b4; border-radius: 6px; background: #ffffff; color: #a12525; font-size: 0.82rem; font-family: inherit; cursor: pointer; }
.btn-danger:hover { background: #fdecec; }

.table-scroll { overflow-x: auto; }
.channel-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.channel-table th { text-align: left; padding: 10px 10px; border-bottom: 2px solid #dde6ec; color: #5b6b7b; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.channel-table td { padding: 12px 10px; border-bottom: 1px solid #edf2f5; vertical-align: top; }
.channel-table code.secret { letter-spacing: 0.08em; }

/* ---------- Usage dialog ---------- */
.console-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-back { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px 24px; background: rgba(13, 12, 63, 0.55); overflow-y: auto; }
.modal-card { width: 100%; max-width: 860px; background: #ffffff; border-radius: 16px; padding: 22px 24px 26px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 1.25rem; color: #14153f; }
.modal-close { width: 36px; height: 36px; border: 0; border-radius: 8px; background: #eef3f6; color: #33475b; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.modal-close:hover { background: #dfe8ee; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 14px; border-bottom: 1px solid #dde6ec; }
.tab { padding: 9px 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #4a5a6b; font-family: inherit; font-size: 0.92rem; font-weight: 500; cursor: pointer; }
.tab:hover { color: #14153f; }
.tab.active { color: #6b2b65; border-bottom-color: #6b2b65; font-weight: 700; }
.code-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: #cfd6ff; font-size: 0.85rem; }
.code-bar .copy { background: rgba(255, 255, 255, 0.1); color: #ffffff; border-color: rgba(255, 255, 255, 0.3); }
.code-bar .copy:hover { background: rgba(255, 255, 255, 0.2); }
.tab-body .code-box pre { white-space: pre; max-height: 55vh; overflow: auto; }
