/* CommerceFlow — point d'entrée SaaS. Réutilise les variables de style.css. */

.saas-shell [hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, var(--hero), transparent 36%),
    radial-gradient(circle at 92% 28%, var(--soft), transparent 30%);
  background-attachment: fixed;
}

.saas-skip {
  position: absolute;
  left: 12px;
  top: -70px;
  z-index: 100;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.saas-skip:focus {
  top: 12px;
}

.saas-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.saas-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1180px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 48px) 0;
}

.saas-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.saas-brand {
  flex: 0 0 auto;
}

.saas-nav {
  display: flex;
  gap: 8px;
}

.saas-demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.saas-demo:hover {
  border-color: var(--accent);
  background: var(--soft);
}

.saas-main {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  gap: clamp(30px, 5vw, 72px);
  align-items: start;
  padding: clamp(34px, 6vw, 72px) 0;
}

.saas-intro {
  max-width: 580px;
  padding-top: 16px;
}

.saas-eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.saas-intro h1 {
  margin: 0 0 22px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(40px, 5.2vw, 64px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -2px;
}

.saas-lead {
  max-width: 480px;
  margin: 0 0 26px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
}

.saas-points {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink);
  font-size: 13px;
}

.saas-points li {
  position: relative;
  padding-left: 26px;
}

.saas-points li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.saas-intro-note {
  margin: 28px 0 0;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.saas-panel {
  min-height: 380px;
  padding: clamp(22px, 3.5vw, 34px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.saas-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: 12px;
  background: var(--soft);
}

.saas-tab {
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.saas-tab[aria-selected='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px #00000014;
}

.saas-form h2,
.saas-check h2,
.saas-section h2 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.4px;
}

.saas-help {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.saas-field {
  margin: 0 0 16px;
}

.saas-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.saas-field input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.saas-field input:focus-visible {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--soft);
}

.saas-field input[aria-invalid='true'] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px #aa393922;
}

.saas-field-error {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
}

.saas-field-error:empty {
  display: none;
}

.saas-password {
  position: relative;
}

.saas-password input {
  padding-right: 92px;
}

.saas-reveal {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.saas-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.saas-submit:hover:not(:disabled) {
  filter: brightness(0.94);
}

.saas-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.saas-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--soft);
}

.saas-link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.saas-switch {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.saas-out-of-scope {
  margin: 10px 0 0;
  font-size: 11px;
  text-align: center;
}

.saas-alert {
  margin: 0 0 16px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

.saas-alert p {
  margin: 0;
}

.saas-alert-error {
  border-left-color: var(--danger);
  background: #aa39390f;
}

.saas-alert-success {
  border-left-color: var(--accent);
}

.saas-alert-info {
  border-left-color: var(--muted);
}

.saas-alert-warning {
  border-left-color: #b87514;
  background: #b8751414;
}

.saas-alert-title {
  margin-bottom: 4px !important;
  font-weight: 800;
}

.saas-alert-help {
  color: var(--muted);
}

.saas-alert a {
  color: var(--accent);
  font-weight: 700;
}

.saas-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
  color: var(--muted);
  font-size: 12px;
}

.saas-loading-compact {
  padding: 8px 0 14px;
}

.saas-spinner {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: saas-spin 0.8s linear infinite;
}

@keyframes saas-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .saas-spinner {
    animation: none;
  }
}

.saas-account {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.saas-account-identity {
  min-width: 0;
}

.saas-account-email {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.saas-section {
  margin-top: 22px;
}

.saas-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.saas-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.saas-shop-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.saas-shop {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
}

.saas-shop:hover {
  border-color: var(--accent);
  background: var(--soft);
}

.saas-shop[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.saas-shop-avatar {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--warm);
  font-family: Georgia, serif;
  font-size: 18px;
}

.saas-shop-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.saas-shop-body strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.saas-shop-meta {
  color: var(--muted);
  font-size: 10px;
}

.saas-shop-state {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.saas-empty {
  margin: 12px 0 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.saas-reload {
  margin-top: 12px;
}

.saas-selected {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: var(--soft);
}

.saas-selected h2 {
  margin: 4px 0 8px;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.saas-selected-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.saas-open-shop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.saas-open-shop:hover {
  filter: brightness(0.96);
}

#shop-limit-note {
  margin: 22px 0;
}

#shop-limit-note p {
  margin: 4px 0 0;
  line-height: 1.55;
}

.saas-create {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.saas-create h2 {
  margin-bottom: 6px;
}

.saas-check h2 {
  margin-bottom: 14px;
}

.saas-check p {
  font-size: 13px;
  line-height: 1.6;
}

.saas-check strong {
  overflow-wrap: anywhere;
}

.saas-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding: 18px 0 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.saas-footer p {
  margin: 0;
}

.saas-footer a {
  color: var(--accent);
  font-weight: 700;
}

.saas-version {
  font-variant-numeric: tabular-nums;
}

.saas-shell h1:focus-visible,
.saas-shell h2:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

@media (max-width: 860px) {
  .saas-main {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 30px;
  }

  .saas-intro {
    max-width: none;
    padding-top: 0;
  }

  .saas-intro h1 {
    font-size: clamp(36px, 9vw, 52px);
  }

  .saas-lead {
    max-width: none;
  }

  .saas-panel {
    min-height: 0;
    padding: 22px;
    border-radius: 16px;
  }
}

@media (max-width: 520px) {
  .saas-shell {
    padding: 18px 14px 0;
  }

  .saas-header {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 18px;
  }

  .saas-nav,
  .saas-demo {
    width: 100%;
  }

  .saas-intro h1 {
    letter-spacing: -1.2px;
  }

  .saas-account {
    flex-direction: column;
  }

  .saas-account .saas-secondary {
    width: 100%;
  }

  .saas-shop {
    flex-wrap: wrap;
  }

  .saas-shop-state {
    margin-left: 50px;
  }

  .saas-footer {
    flex-direction: column;
    gap: 8px;
  }
}
