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

:root {
  --resolve-blue: #5e99ff;
  --resolve-blue-dark: #4871ad;
  --resolve-blue-soft: #8fa9f5;
  --resolve-blue-light: #dfe8ff;
  --resolve-green: #7fe786;
  --resolve-text: #353e42;
  --resolve-text-muted: #667378;
  --resolve-text-dark: #283033;
  --resolve-border: #dce2e6;
  --resolve-bg: #f8fafc;
  --resolve-card-shadow: 0 8px 32px rgba(25, 45, 87, 0.08);
  --resolve-sidebar-width: 248px;
  --resolve-header-height: 72px;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--resolve-text);
  background: #fff;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

/* ── Auth split layout ── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 44%) 1fr;
}

.auth-left {
  position: relative;
  background: var(--resolve-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 32px 48px 24px;
}

.auth-logo img { height: 42px; width: auto; }

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--resolve-card-shadow);
  padding: 32px;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  color: var(--resolve-text-dark);
}

.auth-card .subtitle {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--resolve-text-muted);
}

.auth-card .subtitle strong { color: var(--resolve-text-dark); font-weight: 600; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--resolve-blue);
  font-size: 14px;
  margin-bottom: 20px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--resolve-text-dark);
  margin-bottom: 8px;
}

.input-wrap {
  position: relative;
}

.input-wrap svg, .input-wrap img.icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  opacity: 0.45;
}

.input-wrap input {
  width: 100%;
  height: 48px;
  border: 1px solid #d0dfea;
  border-radius: 10px;
  padding: 0 14px 0 42px;
  font-size: 15px;
  color: var(--resolve-text-dark);
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.input-wrap input:focus {
  border-color: var(--resolve-blue);
  box-shadow: 0 0 0 3px rgba(94, 153, 255, 0.15);
}

.input-wrap input.no-icon { padding-left: 14px; }

.btn-primary {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: var(--resolve-blue-soft);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, opacity .2s;
}

.btn-primary:hover { background: #7a96f0; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--resolve-text-muted);
  font-size: 13px;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--resolve-border);
}

.btn-govbr {
  width: 100%;
  height: 48px;
  border: 1px solid var(--resolve-border);
  border-radius: 999px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
}

.btn-govbr img { height: 22px; }

.cnpj-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f2f7fa;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  flex-wrap: nowrap;
}

.cnpj-box .icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--resolve-blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cnpj-box .icon-circle svg { width: 20px; height: 20px; color: var(--resolve-blue); }

.cnpj-box .info {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  color: var(--resolve-text-muted);
  white-space: nowrap;
}

.cnpj-box .info strong,
.cnpj-box .info .doc-mask {
  color: var(--resolve-text-dark);
  white-space: nowrap;
}

.cnpj-box .change {
  color: var(--resolve-blue);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0 24px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--resolve-text-muted);
}

.checkbox-row input { margin-top: 3px; accent-color: var(--resolve-blue); }
.checkbox-row a { color: var(--resolve-blue); text-decoration: underline; }

.phone-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
}

.country-select {
  height: 48px;
  border: 1px solid #d0dfea;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #fff;
  font-size: 14px;
}

.country-select img { width: 22px; border-radius: 2px; }

.otp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.otp-grid input {
  width: 100%;
  aspect-ratio: 1;
  max-height: 56px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
  border: 1px solid #d0dfea;
  border-radius: 10px;
  outline: none;
}

.form-error {
  margin: -8px 0 16px;
  font-size: 13px;
  line-height: 1.4;
  color: #dc2626;
}

.form-error[hidden] {
  display: none;
}

.btn-primary.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.link-btn {
  border: none;
  background: none;
  color: #5e99ff;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

.otp-grid input:focus {
  border-color: var(--resolve-blue);
  box-shadow: 0 0 0 3px rgba(94, 153, 255, 0.15);
}

.otp-resend {
  text-align: center;
  font-size: 14px;
  color: var(--resolve-text-muted);
  margin-bottom: 24px;
}

.auth-footer {
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: #9aa3a8;
  padding-top: 16px;
}

.auth-footer a { text-decoration: underline; }

/* ── Toast notifications ── */
.resolve-toast-stack {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}

.resolve-toast-stack--auth {
  position: absolute;
  bottom: 20px;
  left: 48px;
  right: auto;
  z-index: 6;
}

.resolve-toast {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: min(340px, calc(100vw - 96px));
  min-height: 48px;
  padding: 11px 34px 11px 12px;
  border-radius: 6px;
  border: 1px solid;
  box-shadow: 0 2px 10px rgba(28, 35, 40, 0.06);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.resolve-toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
}

.resolve-toast--error {
  background: #fdedec;
  border-color: #fadbd8;
  color: #cf1322;
}

.resolve-toast--success {
  background: #e8f5e9;
  border-color: #c8e6c9;
  color: #2e7d32;
}

.resolve-toast__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.resolve-toast--error .resolve-toast__icon { color: #cf1322; }
.resolve-toast--success .resolve-toast__icon { color: #43a047; }

.resolve-toast__message {
  margin: 0;
  flex: 0 1 auto;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: inherit;
  white-space: nowrap;
}

.resolve-toast__close {
  position: absolute;
  top: 7px;
  right: 8px;
  border: none;
  background: none;
  padding: 0;
  width: 18px;
  height: 18px;
  font-size: 16px;
  line-height: 18px;
  color: #b0b8bd;
  cursor: pointer;
}

.resolve-toast__close:hover { color: #8a9399; }

@media (max-width: 900px) {
  .resolve-toast-stack,
  .resolve-toast-stack--auth {
    left: 24px;
    right: 24px;
    bottom: 16px;
  }

  .resolve-toast {
    max-width: 100%;
  }

  .resolve-toast__message {
    white-space: normal;
  }
}

.auth-right {
  position: relative;
  min-height: 100vh;
  background: url('/app/images/login-bg-hero.webp') center/cover no-repeat;
}

.auth-right::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.08), rgba(0,0,0,.18));
}

.auth-help {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

.auth-help .chat-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--resolve-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-help .chat-icon svg { width: 14px; height: 14px; fill: #fff; }

.auth-tagline {
  position: absolute;
  right: 64px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  color: #fff;
  max-width: 340px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
  font-weight: 300;
}

.auth-tagline strong { font-weight: 700; }

.auth-tagline .line {
  display: block;
  width: 48px;
  height: 4px;
  background: var(--resolve-blue);
  margin-top: 16px;
  border-radius: 2px;
}

/* ── Dashboard layout ── */
.dashboard-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--resolve-sidebar-width) 1fr;
  grid-template-rows: var(--resolve-header-height) 1fr auto;
  background: #f5f7f9;
}

.dash-header {
  grid-column: 1 / -1;
  background: #fff;
  border-bottom: 1px solid var(--resolve-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px 0 24px;
  height: var(--resolve-header-height);
}

.dash-header .logo img { height: 38px; }

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid var(--resolve-border);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
  background: #fff;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--resolve-blue-light);
  color: var(--resolve-blue);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-sidebar {
  background: #fff;
  border-right: 1px solid var(--resolve-border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: relative;
}

.dash-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  font-size: 15px;
  color: var(--resolve-text-muted);
  border-left: 3px solid transparent;
}

.dash-nav a.active {
  color: var(--resolve-text-dark);
  font-weight: 600;
  border-left-color: var(--resolve-blue);
  background: rgba(94, 153, 255, 0.06);
}

.dash-nav svg { width: 20px; height: 20px; flex-shrink: 0; }

.sidebar-help {
  margin-top: auto;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--resolve-text-muted);
  text-decoration: none;
}

.sidebar-help:hover { color: var(--resolve-text-dark); }

.sidebar-help .chat-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--resolve-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-help .chat-icon svg { width: 16px; height: 16px; fill: #fff; }

.dash-main {
  padding: 32px 40px 48px;
  background:
    url('/app/images/home-bg.svg') center/480px repeat,
    linear-gradient(180deg, #f5f7f9 0%, #eef2f5 100%);
  min-height: calc(100vh - var(--resolve-header-height) - 56px);
}

.dash-greeting .date {
  font-size: 14px;
  color: var(--resolve-text-muted);
  margin-bottom: 4px;
}

.dash-greeting h1 {
  margin: 0 0 24px;
  font-size: 32px;
  font-weight: 700;
  color: var(--resolve-text-dark);
}

.status-banner {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid #b8d4ff;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 40px;
}

.status-banner .left {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 28px;
  font-weight: 600;
  color: var(--resolve-text-dark);
  white-space: nowrap;
}

.status-banner .divider-v {
  width: 1px;
  background: #b8d4ff;
  margin: 12px 0;
}

.status-banner .right {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 20px 28px;
  color: var(--resolve-blue);
  font-weight: 500;
  font-size: 15px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--resolve-text-dark);
  margin: 0 0 20px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.dash-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(25, 45, 87, 0.06);
  padding: 24px;
  min-height: 220px;
}

.dash-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.dash-card .card-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.dash-card .card-head a {
  color: var(--resolve-blue);
  font-size: 14px;
  font-weight: 500;
}

.dash-card .empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0 8px;
  color: var(--resolve-text-muted);
  font-size: 14px;
}

.dash-card .empty img, .dash-card .empty svg { width: 72px; height: 72px; opacity: .85; }

.service-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.service-card .head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.service-card .head svg { width: 28px; height: 28px; color: var(--resolve-blue); }

.service-card .head h3 { margin: 0; font-size: 17px; }

.service-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--resolve-text-muted);
  flex: 1;
}

.service-card .btn-action {
  align-self: flex-start;
  margin-top: 8px;
  height: 44px;
  padding: 0 24px;
  border: none;
  border-radius: 999px;
  background: var(--resolve-blue);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.dash-footer {
  grid-column: 1 / -1;
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: #9aa3a8;
  background: #fff;
  border-top: 1px solid var(--resolve-border);
}

.dash-footer a { text-decoration: underline; }

/* Account page */
.page-head { margin-bottom: 28px; }
.page-head h1 { margin: 0 0 6px; font-size: 28px; font-weight: 700; }
.page-head p { margin: 0; color: var(--resolve-text-muted); font-size: 15px; }

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(25, 45, 87, 0.06);
}

.profile-card .user-avatar { width: 48px; height: 48px; font-size: 16px; }

.profile-card .name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.profile-card .doc { font-size: 14px; color: var(--resolve-text-muted); }

.field-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 2px 12px rgba(25, 45, 87, 0.06);
}

.field-row { margin-bottom: 24px; }
.field-row:last-child { margin-bottom: 0; }

.field-row label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.field-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--resolve-border);
  border-radius: 10px;
  padding: 0 14px;
  height: 48px;
  background: #fafbfc;
}

.field-input span { flex: 1; font-size: 15px; }
.field-input button {
  border: none;
  background: none;
  cursor: pointer;
  opacity: .5;
  padding: 4px;
}

/* Email preview */
.email-preview-page {
  min-height: 100vh;
  background: #eceff1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.email-card {
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
}

.email-logos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
}

.email-logos img { height: 36px; }

.email-hero {
  background: #323739;
  padding: 32px;
  position: relative;
}

.email-hero::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--resolve-blue);
}

.email-hero h2 {
  margin: 0;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
}

.email-hero h2 span { color: var(--resolve-blue); }

.email-body { padding: 32px; color: #475467; font-size: 15px; line-height: 1.6; }
.email-body .hello { margin-bottom: 16px; }
.email-body .hello strong { color: var(--resolve-blue); }

.code-box {
  margin: 24px auto;
  max-width: 360px;
  background: #f2f7fa;
  border: 1px solid var(--resolve-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--resolve-text-dark);
}

.email-footer-note {
  border-top: 1px solid var(--resolve-border);
  padding: 20px 32px;
  font-size: 13px;
  color: var(--resolve-text-muted);
  background: #fafbfc;
}

@media (max-width: 960px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-right { min-height: 280px; order: -1; }
  .auth-left { min-height: auto; padding: 24px; }
  .auth-tagline { right: 24px; left: 24px; font-size: 24px; }
  .dashboard-page { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
  .cards-grid { grid-template-columns: 1fr; }
  .status-banner { flex-direction: column; }
  .status-banner .divider-v { width: auto; height: 1px; margin: 0 20px; }
}
