/* Carduu widget guide */

.widget-container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.widget-hero {
  background:
    linear-gradient(135deg, rgba(29, 78, 216, 0.94), rgba(37, 99, 235, 0.9)),
    linear-gradient(90deg, #0f766e, #2563eb);
  color: #f8fafc;
  padding: clamp(56px, 8vw, 96px) 0 clamp(44px, 6vw, 72px);
}

.widget-hero-inner {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  text-align: center;
}

.widget-eyebrow {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #fef3c7;
}

.widget-hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0;
}

.widget-hero-copy {
  margin: 18px auto 0;
  max-width: 680px;
  color: #dbeafe;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  line-height: 1.65;
}

.widget-hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.widget-hero-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
}

.widget-builder-section {
  background: #ffffff;
  padding: clamp(48px, 7vw, 84px) 0;
}

.widget-section-header {
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
}

.widget-section-header h2 {
  margin: 0 0 10px;
  color: #111827;
  font-size: clamp(1.7rem, 3.4vw, 2.7rem);
  font-weight: 850;
  letter-spacing: 0;
}

.widget-section-header p {
  margin: 0;
  color: #64748b;
  font-size: 1rem;
  line-height: 1.65;
}

.widget-builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
  align-items: start;
  gap: 28px;
}

.widget-settings-panel,
.preview-sticky,
.generated-code-panel {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.widget-settings-panel {
  padding: clamp(18px, 3vw, 28px);
}

.widget-step {
  padding: 22px 0;
  border-top: 1px solid #e5e7eb;
}

.widget-step:first-child {
  padding-top: 0;
  border-top: 0;
}

.widget-step-label {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 800;
}

.widget-step h3,
.position-fine-tune h3 {
  margin: 0 0 14px;
  color: #0f172a;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0;
}

.widget-label {
  display: block;
  margin: 0 0 7px;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 750;
}

.input-wrapper {
  position: relative;
}

.widget-input,
.widget-select {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-size: 0.96rem;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.widget-input:focus,
.widget-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.url-input {
  padding-right: 42px;
}

.validation-icon {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
}

.validation-icon .hidden,
.feedback-message.hidden,
.generated-code-panel.hidden,
.inline-info.hidden,
.position-fine-tune.hidden {
  display: none !important;
}

.url-input.valid {
  border-color: #059669;
}

.url-input.invalid {
  border-color: #dc2626;
}

.feedback-message {
  margin-top: 7px;
  font-size: 0.84rem;
}

.feedback-message.success {
  color: #047857;
}

.feedback-message.error {
  color: #b91c1c;
}

.widget-help {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 0.86rem;
}

.widget-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.inline-info {
  min-height: 74px;
  padding: 11px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.85rem;
  line-height: 1.45;
}

.inline-info strong,
.inline-info code {
  display: block;
}

.inline-info code {
  margin-top: 5px;
  color: #1d4ed8;
  word-break: break-all;
}

.position-fine-tune {
  padding: 16px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.fine-tune-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.fine-tune-header p {
  margin: -8px 0 0;
  color: #64748b;
  font-size: 0.86rem;
}

.fine-tune-header span {
  align-self: flex-start;
  white-space: nowrap;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 5px 9px;
  font-size: 0.75rem;
  font-weight: 800;
}

.anchor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.anchor-option {
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.anchor-option:hover {
  border-color: #2563eb;
}

.anchor-option.is-active {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #ffffff;
}

.offset-grid {
  display: grid;
  gap: 12px;
}

.offset-control {
  display: grid;
  grid-template-columns: 80px minmax(100px, 1fr) 64px 22px;
  align-items: center;
  gap: 10px;
}

.offset-control label {
  margin: 0;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 750;
}

.offset-control input[type="range"] {
  width: 100%;
  accent-color: #2563eb;
}

.offset-control input[type="number"] {
  width: 64px;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #111827;
  text-align: right;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.style-card {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  color: #334155;
  font-weight: 750;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.style-card:has(.style-radio:checked) {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.style-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.style-swatch {
  width: 28px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.style-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.style-solid {
  background: #007bff;
}

.style-minimal {
  background: #ffffff;
}

.style-success {
  background: #10b981;
}

.style-dark {
  background: #1f2937;
}

.style-outline {
  background: #ffffff;
  border: 2px solid #3b82f6;
}

.widget-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 22px;
  border-top: 1px solid #e5e7eb;
}

.widget-primary-button,
.widget-secondary-button,
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.widget-primary-button {
  background: #1d4ed8;
}

.widget-secondary-button {
  background: #0f766e;
}

.copy-btn {
  min-height: 40px;
  padding: 0 14px;
  background: #2563eb;
}

.widget-primary-button:hover,
.widget-secondary-button:hover,
.copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
}

.widget-primary-button:disabled,
.widget-secondary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.preview-sticky {
  position: sticky;
  top: 84px;
  padding: 18px;
}

.preview-title-row,
.generated-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.preview-title-row p,
.generated-code-header p {
  margin: 0 0 4px;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 850;
}

.preview-title-row h3,
.generated-code-header h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1.18rem;
  font-weight: 850;
}

.live-pill {
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 900;
}

.preview-stage {
  margin-top: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.preview-window-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #e5edf7;
}

.preview-window-bar span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #94a3b8;
}

.preview-page-surface {
  position: relative;
  min-height: 320px;
  padding: 28px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(226, 232, 240, 0.65) 1px, transparent 1px),
    linear-gradient(0deg, rgba(226, 232, 240, 0.65) 1px, transparent 1px),
    #ffffff;
  background-size: 28px 28px;
}

.preview-content-line {
  height: 12px;
  border-radius: 999px;
  background: #dbeafe;
}

.line-wide {
  width: 72%;
}

.line-medium {
  width: 48%;
  margin-top: 12px;
}

.preview-content-block {
  width: 64%;
  height: 92px;
  margin-top: 26px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.preview-button-slot {
  position: absolute;
  right: 30px;
  bottom: 30px;
  transition: top 0.18s ease, right 0.18s ease, bottom 0.18s ease, left 0.18s ease;
}

.preview-button-slot.is-inline {
  position: static;
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.preview-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  max-width: min(240px, calc(100vw - 96px));
  padding: 13px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.preview-button:hover {
  transform: translateY(-2px);
}

.preview-button svg {
  flex: 0 0 auto;
}

.preview-button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-info {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.9rem;
}

.preview-info div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.preview-info strong {
  color: #0f172a;
}

.preview-note {
  margin: 14px 0 0;
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.55;
}

.generated-code-panel {
  margin-top: 28px;
  overflow: hidden;
}

.generated-code-header {
  padding: 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.code-content {
  width: 100%;
  max-width: 100%;
  min-height: 116px;
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  border: 0;
  background: #0f172a;
  color: #86efac;
  font-size: 0.9rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.install-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 18px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.92rem;
}

.install-note code {
  border-radius: 6px;
  background: #dbeafe;
  padding: 2px 6px;
}

.widget-help-section {
  background: #f8fafc;
  padding: clamp(40px, 6vw, 72px) 0;
}

.widget-help-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.widget-help-grid > div {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 20px;
}

.help-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #ffffff;
  font-weight: 900;
}

.widget-help-grid h3 {
  margin: 14px 0 8px;
  color: #0f172a;
  font-size: 1.04rem;
  font-weight: 850;
}

.widget-help-grid p {
  margin: 0;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.6;
}

.custom-alert {
  animation: widgetAlertIn 0.22s ease-out;
}

@keyframes widgetAlertIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1023px) {
  .widget-builder-layout {
    grid-template-columns: 1fr;
  }

  .preview-sticky {
    position: static;
  }

  .widget-help-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .widget-container {
    width: min(100% - 24px, 1120px);
  }

  .widget-settings-panel,
  .preview-sticky {
    padding: 16px;
  }

  .widget-two-column,
  .widget-actions,
  .style-grid,
  .widget-help-grid {
    grid-template-columns: 1fr;
  }

  .anchor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .offset-control {
    grid-template-columns: 1fr 64px 22px;
  }

  .offset-control label {
    grid-column: 1 / -1;
  }

  .fine-tune-header,
  .preview-title-row,
  .generated-code-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-page-surface {
    min-height: 280px;
    padding: 20px;
  }

  .preview-button-slot {
    right: 20px;
    bottom: 20px;
  }

  .preview-button {
    max-width: calc(100vw - 88px);
    padding: 12px 16px;
    font-size: 13px;
  }

  .copy-btn {
    width: 100%;
  }
}
