/* Marketing library tools — dark theme, Aviflow polish */

.tool-form-shell {
  max-width: 640px;
  margin: 0 auto;
}

/* Card: gradient rim + calmer inner panel */
form.tool-wizard.card.tool-form-card {
  --tool-inner-bg: rgba(12, 14, 28, 0.72);
  --tool-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2399a3b8' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
  --tool-select-arrow-focus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23b8c5d9' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
  color-scheme: dark;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  gap: 0;
  position: relative;
  padding: clamp(1.25rem, 4vw, 1.75rem);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(var(--tool-inner-bg), var(--tool-inner-bg)) padding-box,
    linear-gradient(145deg, rgba(122, 91, 255, 0.45), rgba(56, 232, 255, 0.22) 45%, rgba(255, 255, 255, 0.08)) border-box;
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 24px 56px rgba(4, 6, 20, 0.45);
}

form.tool-wizard.card.tool-form-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, rgba(122, 91, 255, 0.9), rgba(56, 232, 255, 0.75), transparent);
  opacity: 0.85;
  pointer-events: none;
}

.tool-form-header {
  margin: 0 0 0.25rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tool-form-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(56, 232, 255, 0.92);
}

.tool-form-lead {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

form.tool-wizard.card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  gap: 0;
}

.tool-wizard {
  max-width: 640px;
  margin: 0 auto;
}

.tool-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.35rem;
  position: relative;
  padding-bottom: 0.15rem;
}

/* Open <select> overlays following rows */
.tool-field:focus-within {
  z-index: 2;
}

.tool-wizard > .tool-field:first-of-type {
  margin-top: 1.1rem;
}

.tool-field--actions {
  margin-top: 1.75rem;
  padding-top: 0.25rem;
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tool-field--actions .btn {
  width: 100%;
  max-width: 100%;
  min-height: 54px;
  font-size: 1rem;
}

@media (min-width: 480px) {
  .tool-field--actions .btn {
    width: auto;
    min-width: min(100%, 280px);
    align-self: flex-start;
  }
}

.tool-wizard label,
.tool-lead-form label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: #e8eaef;
  margin: 0;
}

.tool-wizard input[type="url"],
.tool-wizard input[type="text"],
.tool-wizard input[type="email"],
.tool-wizard input[type="tel"],
.tool-wizard textarea,
.tool-lead-form input[type="email"],
.tool-lead-form input[type="tel"] {
  width: 100%;
  max-width: 100%;
  padding: 0.85rem 1rem;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.45;
  box-sizing: border-box;
  background-color: rgba(8, 10, 22, 0.82);
  color: var(--text);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 8px 22px rgba(0, 0, 0, 0.28);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Native <select>: own stack — was missing for .tool-wizard (stayed white in Safari/Chrome) */
.tool-wizard select,
.tool-lead-form select {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.85rem 2.75rem 0.85rem 1rem;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.45;
  box-sizing: border-box;
  color: var(--text);
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  text-overflow: ellipsis;
  background-color: rgba(8, 10, 22, 0.88);
  background-image: var(--tool-select-arrow, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2399a3b8' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E"));
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 11px 7px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 8px 22px rgba(0, 0, 0, 0.28);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.tool-wizard select::-ms-expand,
.tool-lead-form select::-ms-expand {
  display: none;
}

.tool-wizard select option,
.tool-lead-form select option {
  background: #1a1f33;
  color: var(--text);
}

.tool-wizard textarea {
  min-height: 112px;
  padding-top: 0.95rem;
  resize: vertical;
}

.tool-wizard input::placeholder,
.tool-wizard textarea::placeholder,
.tool-lead-form input::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

.tool-wizard input:-webkit-autofill,
.tool-wizard input:-webkit-autofill:hover,
.tool-wizard textarea:-webkit-autofill,
.tool-lead-form input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 99999s ease-out;
  box-shadow: 0 0 0 1000px rgba(8, 10, 22, 0.92) inset !important;
}

.tool-wizard input:hover,
.tool-wizard textarea:hover,
.tool-lead-form input:hover {
  border-color: rgba(255, 255, 255, 0.26);
  background-color: rgba(12, 14, 28, 0.88);
}

.tool-wizard select:hover,
.tool-lead-form select:hover {
  border-color: rgba(255, 255, 255, 0.26);
  background-color: rgba(12, 14, 28, 0.9);
  background-image: var(--tool-select-arrow, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2399a3b8' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E"));
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 11px 7px;
}

.tool-wizard select:focus,
.tool-lead-form select:focus {
  outline: none;
  border-color: rgba(122, 91, 255, 0.65);
  background-color: rgba(14, 16, 32, 0.92);
  background-image: var(--tool-select-arrow-focus, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23b8c5d9' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E"));
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 11px 7px;
  box-shadow:
    0 0 0 3px rgba(122, 91, 255, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 28px rgba(0, 0, 0, 0.28);
}

.tool-wizard input:focus,
.tool-wizard textarea:focus,
.tool-lead-form input:focus {
  outline: none;
  border-color: rgba(122, 91, 255, 0.65);
  box-shadow:
    0 0 0 3px rgba(122, 91, 255, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 28px rgba(0, 0, 0, 0.28);
  background-color: rgba(14, 16, 32, 0.92);
}

.tool-wizard .form-actions {
  margin-top: 0;
}

.tool-result {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tool-result > h2 {
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  margin-bottom: 1.25rem;
  color: var(--text);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .tool-result > h2 {
    background: linear-gradient(120deg, #fff 0%, #c8d4e8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.tool-result[data-tool-result][hidden] {
  display: none !important;
}

.tool-sbs__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
  margin-top: 1.1rem;
}

.tool-sbs__col {
  padding: 1.15rem 1.2rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06) 0%, rgba(8, 10, 22, 0.65) 100%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.tool-sbs__col--aviflow {
  border-color: rgba(56, 232, 255, 0.4);
  background: linear-gradient(165deg, rgba(56, 232, 255, 0.12) 0%, rgba(8, 14, 28, 0.72) 100%);
  box-shadow:
    0 0 0 1px rgba(56, 232, 255, 0.12),
    0 18px 44px rgba(0, 0, 0, 0.25);
}

.tool-sbs__title,
.tool-sbs__col h3,
.tool-sbs__col h4 {
  color: var(--text);
}

.tool-sbs__body {
  color: var(--muted);
}

.tool-triggers,
.tool-steps {
  padding-left: 1.25rem;
}

.tool-triggers li,
.tool-steps li {
  margin: 0.35rem 0;
  color: var(--muted);
}

.tool-rec {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text);
}

.tool-muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.tool-lead {
  margin-top: 2.25rem;
  padding: clamp(1.25rem, 3vw, 1.6rem);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(122, 91, 255, 0.1) 0%, rgba(12, 14, 28, 0.75) 42%);
  box-shadow: 0 20px 50px rgba(4, 6, 20, 0.35);
  color-scheme: dark;
  --tool-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2399a3b8' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
  --tool-select-arrow-focus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23b8c5d9' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
}

.tool-lead-form .tool-field--actions .btn {
  width: 100%;
  max-width: 100%;
  min-height: 54px;
}

@media (min-width: 560px) {
  .tool-lead-form .tool-field--actions .btn {
    width: auto;
    max-width: 100%;
  }
}

.tool-lead h3 {
  margin-top: 0;
  color: var(--text);
}

.tool-lead > p {
  color: var(--muted);
  line-height: 1.5;
}

.tool-lead .tool-field {
  margin-top: 1.1rem;
}

.tool-lead .tool-field:first-of-type {
  margin-top: 0.5rem;
}

.tool-lead .form-actions {
  margin-top: 0;
}

.tool-lead-form {
  display: flex;
  flex-direction: column;
}

.tool-error {
  padding: 0.75rem 1rem;
  background: rgba(180, 40, 40, 0.15);
  border: 1px solid rgba(255, 120, 120, 0.35);
  border-radius: 8px;
  color: #ffb4b4;
  margin-bottom: 1rem;
}

[data-tool-lead-success] {
  padding: 0.75rem 1rem;
  background: rgba(73, 226, 201, 0.12);
  border: 1px solid rgba(73, 226, 201, 0.4);
  border-radius: 8px;
  margin-bottom: 1rem;
  color: var(--success);
}

.tool-consent {
  margin-top: 0.85rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

.tool-consent label {
  font-weight: 400;
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  color: var(--muted);
}

.tool-consent a {
  color: #9cc8ff;
}

.tool-consent input {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}

.tool-noop.card {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}
