/* FenceFlow configurator — polished WOW UI */

@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,600&display=swap");

body.ff-configurator {
  margin: 0;
  min-height: 100vh;
  font-family: Manrope, system-ui, sans-serif;
  color: #1a1c1e;
  background:
    radial-gradient(ellipse 70% 50% at 100% 0%, color-mix(in srgb, var(--brand-accent, var(--brand, #2C2F31)) 16%, transparent), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, color-mix(in srgb, var(--brand, #2C2F31) 10%, transparent), transparent 50%),
    linear-gradient(180deg, var(--brand-surface, #f4f5f7), #eceeef);
}

body.ff-configurator.is-busy { cursor: progress; }
body.ff-configurator.is-busy .ff-btn { opacity: 0.65; pointer-events: none; }

.ff-configurator__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 1.35rem;
  border-bottom: 1px solid rgba(26, 28, 30, 0.08);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.ff-configurator__header a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}
.ff-configurator__brand {
  display: inline-flex;
  align-items: center;
}

.ff-configurator__main {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem) 1.15rem 4rem;
}

.ff-progress {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
}
.ff-progress span {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: rgba(20, 32, 26, 0.12);
  transition: background 0.25s ease;
}
.ff-progress span.is-on {
  background: var(--brand, #1b4332);
}

.ff-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.55;
  margin: 0 0 0.55rem;
}

.ff-card {
  animation: ff-in 0.45s ease both;
}
.ff-card h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 550;
  font-size: clamp(1.9rem, 5vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
.ff-sub {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 1.6rem 0 0.75rem;
}
.ff-lead {
  font-size: 1.05rem;
  margin: 0 0 1.3rem;
  opacity: 0.88;
  max-width: 38rem;
}

.ff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.9rem 1.25rem;
  border-radius: 999px;
  border: none;
  background: var(--brand, #1b4332);
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand, #1b4332) 28%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ff-btn:hover { transform: translateY(-1px); }
.ff-btn--ghost {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(20, 32, 26, 0.2);
  box-shadow: none;
}
.ff-btn--small { padding: 0.6rem 1rem; font-size: 0.92rem; box-shadow: none; }
.ff-btn--accent {
  background: #d4a373;
  color: #1a1a1a;
  box-shadow: 0 10px 24px rgba(212, 163, 115, 0.35);
}

.ff-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.ff-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 0.7rem;
}

.ff-choice {
  position: relative;
  display: grid;
  gap: 0.35rem;
  padding: 1rem 0.95rem 0.95rem;
  border-radius: 1rem;
  border: 1.5px solid rgba(20, 32, 26, 0.1);
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 20px rgba(20, 32, 26, 0.04);
}
.ff-choice:hover { transform: translateY(-2px); }
.ff-choice.is-active {
  border-color: var(--brand, #1b4332);
  box-shadow:
    0 0 0 1px var(--brand, #1b4332),
    0 14px 28px color-mix(in srgb, var(--brand, #1b4332) 18%, transparent);
  background: #fff;
}
.ff-choice__icon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.65rem;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--brand, #1b4332) 10%, #fff);
  color: var(--brand, #1b4332);
  font-size: 1.05rem;
}
.ff-choice__label { font-weight: 700; font-size: 0.98rem; }
.ff-choice__hint { font-size: 0.8rem; opacity: 0.65; line-height: 1.3; }

.ff-field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 0.92rem;
}
.ff-field input,
.ff-field select {
  font: inherit;
  font-weight: 500;
  padding: 0.8rem 0.9rem;
  border-radius: 0.75rem;
  border: 1.5px solid rgba(20, 32, 26, 0.12);
  background: #fff;
}

.ff-toggles { display: grid; gap: 0.65rem; margin: 0.5rem 0 0.25rem; }
.ff-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(20, 32, 26, 0.08);
  font-weight: 650;
  cursor: pointer;
}
.ff-toggle input { width: 1.15rem; height: 1.15rem; accent-color: var(--brand, #1b4332); }

.ff-upload {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0.5rem;
  min-height: 180px;
  padding: 1.5rem;
  border-radius: 1.15rem;
  border: 1.5px dashed color-mix(in srgb, var(--brand, #1b4332) 45%, transparent);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.65));
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.ff-upload:hover { border-color: var(--brand, #1b4332); }
.ff-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.ff-upload strong { font-size: 1.05rem; }
.ff-upload span { font-size: 0.88rem; opacity: 0.7; }
.ff-upload.is-done {
  border-style: solid;
  border-color: var(--brand, #1b4332);
  background: color-mix(in srgb, var(--brand, #1b4332) 8%, #fff);
}

.ff-variants { display: grid; gap: 0.95rem; }
.ff-variant {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1rem;
  align-items: center;
  background: #fff;
  border-radius: 1.15rem;
  padding: 1rem;
  border: 1.5px solid rgba(20, 32, 26, 0.07);
  box-shadow: 0 12px 28px rgba(20, 32, 26, 0.05);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.ff-variant:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand, #1b4332) 40%, transparent); }
.ff-variant__thumb {
  width: 96px;
  height: 96px;
  border-radius: 0.85rem;
  object-fit: cover;
  background: #e4ece6;
}
.ff-variant h3 { margin: 0 0 0.25rem; font-size: 1.08rem; }
.ff-variant p { margin: 0; font-size: 0.92rem; opacity: 0.78; }
.ff-price {
  font-weight: 800;
  color: var(--brand, #1b4332);
  margin: 0.55rem 0 0.75rem;
  font-size: 1.02rem;
}
.ff-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand, #1b4332) 12%, #fff);
  color: var(--brand, #1b4332);
  margin-bottom: 0.35rem;
}

.ff-viz {
  min-height: 200px;
  background: #fff;
  border-radius: 1.15rem;
  padding: 1rem;
  border: 1.5px solid rgba(20, 32, 26, 0.08);
  overflow: hidden;
}
.ff-viz img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  animation: ff-in 0.6s ease both;
}

.ff-form {
  display: grid;
  gap: 0.85rem;
}
.ff-form .ff-field { margin: 0; }

.ff-hint { font-size: 0.88rem; opacity: 0.72; margin-top: 0.75rem; }
.ff-error { color: #8a1f1f; font-weight: 700; }
.ff-success {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--brand, #1b4332) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand, #1b4332) 25%, transparent);
}
.ff-pulse { animation: ff-pulse 1.15s ease-in-out infinite; font-weight: 650; }

@keyframes ff-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes ff-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@media (max-width: 640px) {
  .ff-variant { grid-template-columns: 1fr; }
  .ff-variant__thumb { width: 100%; height: 140px; }
}
