/* imerApp — tema base (Ímer Indigo + Coral Sunrise)
   CSS vars sao sobrescritas por tenant (white-label) em fase posterior. */

:root {
  --color-primary: #2E3A8C;
  --color-accent: #FF7A59;
  --color-primary-dark: color-mix(in srgb, var(--color-primary) 85%, #000);
  --color-on-primary: #ffffff;

  --color-bg: #FAFAF7;
  --color-surface: #ffffff;
  --color-border: #E2E8F0;

  --color-text: #0F172A;
  --color-text-muted: #475569;

  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger: #EF4444;

  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, .08);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
}

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

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.site-header .brand { display: inline-flex; align-items: center; }

.site-footer {
  padding: 40px 32px;
  margin-top: 64px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 14px;
  text-align: center;
}
.site-footer .muted { color: var(--color-text-muted); }

.hero {
  padding: 80px 0 64px;
  background:
    radial-gradient(ellipse at top left,
      color-mix(in srgb, var(--color-primary) 10%, transparent),
      transparent 60%),
    var(--color-bg);
}
.hero .eyebrow {
  display: inline-block;
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  color: var(--color-text);
  font-weight: 700;
}
.hero .lead {
  font-size: 18px;
  color: var(--color-text-muted);
  max-width: 640px;
  margin: 0 0 32px;
}

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
  text-decoration: none;
  line-height: 1.3;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-border);
}
.btn-ghost:hover { background: color-mix(in srgb, var(--color-primary) 8%, transparent); }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  padding: 48px 24px;
}
.feature {
  --feat-color: var(--color-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.feature::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--feat-color);
}
.feature:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--feat-color) 18%, transparent);
}
.feature-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 24px;
  line-height: 1;
  background: color-mix(in srgb, var(--feat-color) 14%, transparent);
  flex-shrink: 0;
}
.feature h3 {
  margin: 0;
  font-size: 18px;
  color: var(--feat-color);
}
.feature p { margin: 0; color: var(--color-text-muted); font-size: 15px; }

/* Paleta rotativa — intercala cores da marca com complementares harmônicas */
.feature:nth-child(1) { --feat-color: #2E3A8C; } /* imerApp primary (índigo) */
.feature:nth-child(2) { --feat-color: #FF7A59; } /* imerApp accent (coral) */
.feature:nth-child(3) { --feat-color: #14B8A6; } /* teal */
.feature:nth-child(4) { --feat-color: #E11D48; } /* rosa quente — "cuidar" */
.feature:nth-child(5) { --feat-color: #F59E0B; } /* âmbar */
.feature:nth-child(6) { --feat-color: #8B5CF6; } /* violeta */

.tenant-notice {
  margin-top: 32px;
  padding: 16px;
  background: color-mix(in srgb, var(--color-accent) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 30%, transparent);
  border-radius: var(--radius);
  text-align: center;
}

/* ---- Formularios (cadastro, convite) ---- */
.container.narrow { max-width: 720px; }
.text-center { text-align: center; }

.form-hero {
  padding: 64px 0 24px;
  background:
    radial-gradient(ellipse at top left,
      color-mix(in srgb, var(--color-primary) 8%, transparent),
      transparent 60%),
    var(--color-bg);
}
.form-hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 12px;
  letter-spacing: -0.015em;
}
.form-hero .lead { color: var(--color-text-muted); max-width: 600px; }
.form-hero .eyebrow {
  display: inline-block;
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.form-card { margin: 16px 0 64px; }

/* Links longos (ex.: nome de arquivo em ClearableFileInput) quebram em vez de
   esticar o container. */
.card a { overflow-wrap: anywhere; word-break: break-word; }
.card input[type="file"] { max-width: 100%; }
.card .field, .card .control { min-width: 0; }
.card .control { display: block; }
.card .control > a {
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
}

.form-section {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-primary);
  margin: 24px 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}
.form-section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

/* minmax(0, 1fr) em vez de 1fr permite que as células encolham abaixo do
   tamanho do conteúdo — necessário quando há strings longas sem quebra
   natural (URLs, nomes de arquivo) dentro dos campos. */
.grid-1 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
@media (max-width: 640px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
}
.field .req { color: var(--color-accent); margin-left: 4px; }
.field .help { font-size: 12px; color: var(--color-text-muted); }
.field .suffix { font-size: 13px; color: var(--color-text-muted); padding-left: 10px; white-space: nowrap; }
.field .control { position: relative; display: flex; align-items: center; gap: 8px; }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="password"],
.field textarea,
.field select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--color-text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 150ms, box-shadow 150ms;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 20%, transparent);
}

.field.has-error input,
.field.has-error textarea,
.field.has-error select {
  border-color: var(--color-danger);
}
.field-error, .field-error ul {
  color: var(--color-danger);
  font-size: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-danger {
  background: color-mix(in srgb, var(--color-danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-danger) 30%, transparent);
  color: color-mix(in srgb, var(--color-danger) 70%, #000);
}

.terms {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 20px 0;
  padding: 14px;
  background: color-mix(in srgb, var(--color-primary) 5%, transparent);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.terms input[type="checkbox"] { margin-top: 4px; transform: scale(1.2); accent-color: var(--color-primary); }
.terms label { font-size: 14px; color: var(--color-text); line-height: 1.5; }

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 24px;
}
.cta-row.center { justify-content: center; }

.muted { color: var(--color-text-muted); }
.small { font-size: 13px; }

.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-success) 15%, transparent);
  color: var(--color-success);
  font-size: 40px;
  line-height: 72px;
  text-align: center;
  margin: 0 auto 24px;
  font-weight: 700;
}

code {
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  color: var(--color-primary);
}
