/*
 * Sign-up page styles.
 *
 * Hand-port of the Tailwind classes used by the legacy
 * cirra-ai/app `signup-form.tsx` so the visual is unchanged after the
 * page moves to cirra.ai/sign-up. Standalone — does not extend the
 * marketing-site header/footer / per-page Elementor CSS.
 *
 * Layout: full-bleed two-pane on desktop (blue marketing panel + white
 * form panel), stacked column-reverse on mobile so the form card sits
 * above the marketing copy and the email input is visible without
 * scrolling. Mirrors `flex-col-reverse md:flex-row`.
 */

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

html, body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: #05184f;
  font-family: 'Sen', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#signup-container {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column-reverse;
  background: #ffffff;
}

/* ---------- left / marketing panel ---------- */

.signup-marketing {
  flex: 1 1 0;
  background: #4068eb;
  color: #ffffff;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.signup-marketing-inner {
  width: 100%;
  margin: 0 auto;
}

.signup-marketing-logo {
  display: none; /* hidden on mobile — the form card carries the logo */
  margin-bottom: 32px;
  width: 152px;
  height: 54px;
  text-decoration: none;
}
.signup-marketing-logo svg { width: 100%; height: 100%; display: block; }

.signup-marketing-h1 {
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.signup-marketing-lead {
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  margin: 0 0 32px;
}

.signup-marketing-list {
  list-style: none;
  margin: 24px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.signup-marketing-list li {
  display: flex;
  align-items: center;
  gap: 16px;
}
.signup-marketing-list p { margin: 0; font-size: 1rem; }
.signup-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: #1890ff;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.signup-marketing-list li > span:last-child {
  font-size: 1rem;
}

.signup-marketing-contact {
  font-size: 1rem;
  color: #ffffff;
  margin: 0 0 16px;
}
.signup-marketing-contact:last-child { margin-bottom: 0; }
.signup-marketing-contact a {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

/* ---------- right / form panel ---------- */

.signup-form-panel {
  flex: 1 1 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 0;
}

.signup-card-wrap {
  width: 100%;
  max-width: 400px;
}

.signup-card {
  width: 100%;
  border-radius: 8px;
  padding: 24px;
  border: 1px solid #e5e5e5;
  background: #ffffff;
}

.signup-card-logo {
  display: block;
  margin: 0 auto 24px;
  width: 120px;
  height: 43px;
  text-decoration: none;
}
.signup-card-logo svg { width: 100%; height: 100%; display: block; }

.signup-card-h2 {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  color: #05184f;
  margin: 0 0 24px;
}

#signup-form { display: flex; flex-direction: column; gap: 16px; }
/* `[hidden]` would normally set display:none, but #signup-form's
 * display:flex above wins by specificity. Explicit override so the
 * runtime misconfig handler can hide the form by setting `hidden`. */
#signup-form[hidden] { display: none; }

.signup-field { display: flex; flex-direction: column; gap: 8px; }
.signup-field label {
  font-size: 0.875rem;
  color: #05184f;
}
.signup-required { color: #dc2626; margin-right: 4px; }

#signup-email {
  width: 100%;
  border-radius: 4px;
  border: 1px solid #d4d4d4;
  background: #ffffff;
  padding: 12px;
  font-size: 1rem;
  line-height: 1.5;
  color: #05184f;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#signup-email::placeholder { color: #a3a3a3; }
#signup-email:focus {
  border-color: #4068eb;
  box-shadow: 0 0 0 2px rgba(64, 104, 235, 0.2);
}
#signup-email.is-invalid {
  border-color: #ef4444;
}
#signup-email.is-invalid:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}
#signup-email:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.signup-error {
  margin: 0;
  font-size: 0.75rem;
  color: #dc2626;
}

/* Shown only when the page boots with a misconfigured APP_BASE_URL or
 * CLOUD_APP_BASE_URL — see the runtime validateBaseUrl() check. The
 * form is hidden and this replaces it inside the same card so the user
 * sees an explicit, actionable message instead of a silently-broken
 * submit. Same red palette as the inline field-error so it reads as a
 * problem at a glance. */
.signup-config-error {
  margin: 0;
  padding: 16px;
  border-radius: 4px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}
.signup-config-error strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 8px;
}
.signup-config-error p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
}
.signup-config-error a {
  color: #b91c1c;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#signup-submit {
  width: 100%;
  height: 40px;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  background: #4068eb;
  color: #ffffff;
  border: 0;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
#signup-submit:hover:not(:disabled) { background: #3458d6; }
#signup-submit:disabled {
  background: #e5e5e5;
  color: #a3a3a3;
  cursor: not-allowed;
}

/* ---------- responsive ---------- */

@media (min-width: 640px) {
  .signup-marketing-h1 { font-size: 2.5rem; }
  .signup-marketing-lead { font-size: 1.125rem; }
  .signup-marketing-list p,
  .signup-marketing-list li > span:last-child { font-size: 1.1rem; }
  .signup-check { width: 24px; height: 24px; font-size: 1rem; }
  .signup-marketing-contact { font-size: 1.125rem; }
  .signup-card { padding: 32px; }
  .signup-card-logo { width: 152px; height: 54px; }
  .signup-card-h2 { font-size: 1.5rem; margin-bottom: 32px; }
  #signup-submit { height: 48px; }
}

@media (min-width: 768px) {
  #signup-container {
    flex-direction: row; /* desktop: side-by-side, marketing on the left */
  }
  .signup-marketing {
    padding: 64px;
  }
  .signup-marketing-inner {
    max-width: 480px;
  }
  .signup-marketing-logo { display: block; }
  .signup-marketing-h1 { font-size: 3rem; }
  .signup-marketing-lead {
    font-size: 1.25rem;
    margin-bottom: 48px;
  }
  .signup-marketing-list { margin: 48px 0; gap: 24px; }
  .signup-form-panel {
    padding: 32px;
  }
  .signup-card {
    border: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  }
}
