/* ============================================================
   e/POST — Landing
   Foundations from El Post Design System (Montserrat, azul #3B6BE3)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

:root {
  --ep-blue:       #3B6BE3;
  --ep-blue-deep:  #1C3B7A;
  --ep-text:       #1A1A2E;
  --ep-text-muted: #6B7280;
  --ep-border:     #E5E7EB;
  --ep-surface:    #FFFFFF;
  --font-sans:     'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ep-surface);
  color: var(--ep-text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Page is a single centered column so logo + form share one axis */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px 56px;
}

/* ---------- Header / brand lockup ---------- */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand__logo {
  height: 56px;
  width: auto;
  display: block;
}

.brand__tagline {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--ep-text-muted);
  max-width: 30ch;
  line-height: 1.5;
  margin: 0;
}

/* Slim brand-blue divider — echoes the "/" of the logo, ties header to form */
.brand__rule {
  width: 48px;
  height: 3px;
  border-radius: 999px;
  background: var(--ep-blue);
  margin-top: 4px;
}

/* ---------- Form embed ---------- */
/* The iframe melts into the page: same white surface, no hard border,
   so it reads as part of the layout rather than a pasted-in box. */
.embed {
  width: 100%;
  max-width: 1100px;
  background: transparent;
}

.embed__frame {
  display: block;
  width: 100%;
  min-height: 1100px;
  border: 0;
  background: transparent;
  color-scheme: light;
}

/* ---------- Auth (login view) ---------- */
/* Hide everything while we resolve session, to avoid flashing the login form */
body.booting #login-view,
body.booting #app-view { visibility: hidden; }

/* App view (authenticated): take full column width so the iframe can expand */
#app-view {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.auth {
  width: 100%;
  max-width: 380px;
  margin-top: 8px;
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 24px 24px;
  background: var(--ep-surface);
  border: 1px solid var(--ep-border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.auth__title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ep-text);
}

.auth__hint {
  font-size: 13px;
  color: var(--ep-text-muted);
  margin: -6px 0 4px;
}

.auth__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ep-text);
}

.auth__field input {
  font: inherit;
  font-weight: 400;
  font-size: 14px;
  color: var(--ep-text);
  padding: 10px 12px;
  border: 1px solid var(--ep-border);
  border-radius: 8px;
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.auth__field input:focus {
  border-color: var(--ep-blue);
  box-shadow: 0 0 0 3px rgba(59, 107, 227, 0.15);
}

.auth__error {
  margin: 0;
  font-size: 13px;
  color: #b42318;
  min-height: 18px;
}

.auth__submit {
  margin-top: 4px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  background: var(--ep-blue);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .15s ease, transform .05s ease;
}

.auth__submit:hover:not(:disabled) { background: var(--ep-blue-deep); }
.auth__submit:active:not(:disabled) { transform: translateY(1px); }
.auth__submit:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Userbar (authenticated state) ---------- */
.userbar {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.userbar__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ep-text);
  background: var(--ep-surface);
  border: 1px solid var(--ep-border);
  padding: 6px 12px;
  border-radius: 999px;
  max-width: 70vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.userbar__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.userbar__logout {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ep-text-muted);
  background: transparent;
  border: 1px solid var(--ep-border);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}

.userbar__logout:hover {
  color: var(--ep-text);
  border-color: #c9ccd1;
}

/* ---------- Responsive ---------- */

/* Tablet */
@media (min-width: 600px) {
  .page { padding: 56px 32px 72px; }
  .brand__logo { height: 64px; }
  .brand__tagline { font-size: 14px; }
}

/* Desktop */
@media (min-width: 1024px) {
  .page { padding: 72px 40px 96px; }
  .brand__logo { height: 72px; }
}

/* Small phones (≈375px and below): tighten padding, scale logo down */
@media (max-width: 400px) {
  .page { padding: 32px 16px 40px; }
  .brand__logo { height: 48px; }
  .auth__form { padding: 22px 18px 20px; }
}
