/* forms.css */

/* =========================
   ========== Base ==========
   ========================= */

:root {
  --ll-accent: #0073aa;
  --ll-accent-ink: #0b4e6f;
  --ll-danger: #e74c3c;
  --ll-muted: #6b7280;
  --ll-border: #ccc;
  --ll-bg-invalid: #fff6f6;
  --ll-gap: 14px;
  --ll-radius: 6px;
  --ll-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Generic input look (optional utility) */
.ll-input {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid var(--ll-border);
  border-radius: 4px;
  font-size: 16px;
  background: #fff;
}

/* Field wrapper and labels */
.ll-field label {
  display: block;
  margin: 0 0 6px;
  font-weight: 600;
  color: #333;
  line-height: 1.25;
}

.ll-field input,
.ll-field select,
.ll-field textarea {
  width: 100%;
  box-sizing: border-box;
  background: #fff;
}

/* Focus: keyboard-friendly and consistent */
.ll-field input:focus-visible,
.ll-field select:focus-visible,
.ll-field textarea:focus-visible,
#start-page-container form input:focus-visible,
#start-page-container form select:focus-visible,
#start-page-container form textarea:focus-visible {
  outline: 3px solid rgba(0,115,170,0.25);
  outline-offset: 1px;
  border-color: var(--ll-accent);
}

/* -------------------------
   Unified error states
-------------------------- */

/* Single source of truth */
.ll-is-invalid,
.ll-field.has-error input,
.ll-field.has-error select,
.ll-field.has-error textarea,
.ll-registration-form.was-submitted input:invalid,
.ll-registration-form.was-submitted textarea:invalid,
.ll-registration-form.was-submitted select:invalid {
  border-color: var(--ll-danger) !important;
  background-color: var(--ll-bg-invalid);
}

/* Optional legacy hooks point to the same style */
.input-error,
input.invalid,
textarea.invalid,
select.invalid {
  border-color: var(--ll-danger) !important;
  background-color: var(--ll-bg-invalid);
}

.ll-error-msg {
  display: none;
  color: var(--ll-danger);
  font-weight: 700;
  margin-bottom: 10px;
}
.ll-field.has-error .ll-error-msg { display: block; }

/* Small utilities */
.save-confirm { color: #2e7d32; margin-left: 6px; font-size: 1.2em; vertical-align: middle; display: none; }
.ll-prompt-message { text-align: center; margin-bottom: 15px; }
#ll-registration-form input[name="phone"] { margin-bottom: 16px; display: block; }

/* ==============================
   === Feature Section Layout ===
   ============================== */

.ll-feature-section {
  background-color: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  margin: 2rem auto;
  max-width: 1000px;
}
.ll-feature-content { opacity: 1; }

/* ==============================
   === Form Container Overrides ==
   ============================== */

#start-page-container,
#email-form-container,
#step2,
.ll-form-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: .5rem;
  box-shadow: var(--ll-shadow);
  max-width: 480px;
  margin: 1rem auto;
}

#start-page-container form label {
  display: block;
  margin-bottom: .25rem;
  font-weight: 600;
  color: #333;
}

#start-page-container form input[type="email"],
#start-page-container form input[type="text"],
#start-page-container form input[type="tel"],
#start-page-container form input[type="url"],
#start-page-container form textarea,
#start-page-container form select {
  display: block; width: 100%; box-sizing: border-box;
  padding: .75rem; margin-bottom: 1rem;
  border: 1px solid var(--ll-border);
  border-radius: .25rem;
  font: inherit;
  background: #fff;
}

/* Buttons */
#start-page-container form input[type="submit"],
#start-page-container form button[type="submit"],
#start-page-container form button {
  display: block; width: 100%;
  padding: .75rem;
  font-size: 1rem; font-weight: 600; color: #fff;
  background-color: var(--ll-accent);
  border: none; border-radius: .25rem; cursor: pointer; text-align: center;
  margin-top: .5rem;
}
#start-page-container form input[type="submit"]:hover,
#start-page-container form button[type="submit"]:hover,
#start-page-container form button:hover {
  background-color: var(--ll-accent-ink);
}

/* Field focus (split from button hover to avoid bleed) */
#start-page-container form input[type="email"]:focus-visible,
#start-page-container form input[type="text"]:focus-visible,
#start-page-container form input[type="tel"]:focus-visible,
#start-page-container form input[type="url"]:focus-visible,
#start-page-container form textarea:focus-visible,
#start-page-container form select:focus-visible {
  outline: 3px solid rgba(0,115,170,0.25);
  outline-offset: 1px;
  border-color: var(--ll-accent);
}

#start-page-container .error,
#start-page-container .form-error { color: #cc0000; font-size: .875rem; margin-bottom: 1rem; }

/* =========================
   ===== Login Form =========
   ========================= */

#custom-login-form {
  max-width: 320px;
  margin: 0 auto;
  display: flex; flex-direction: column;
}
#custom-login-form label { font-weight: 700; margin-bottom: 5px; }
#custom-login-form input[type="text"],
#custom-login-form input[type="password"] {
  padding: 8px; margin-bottom: 15px; width: 100%;
  box-sizing: border-box; border: 1px solid var(--ll-border); border-radius: 4px;
  background: #fff;
}
#custom-login-form input:focus-visible {
  outline: 3px solid rgba(0,115,170,0.25);
  outline-offset: 1px;
  border-color: var(--ll-accent);
}

.password-wrapper { position: relative; display: inline-block; width: 100%; }
.toggle-password, .toggle-password-icon {
  position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
  cursor: pointer; color: #666;
}
.toggle-password:hover, .toggle-password-icon:hover { color: #000; }
.lost-password-link {
  text-align: center; display: block; margin-top: 10px;
  font-size: 14px; color: var(--ll-accent); text-decoration: none;
}
.lost-password-link:hover { text-decoration: underline; }
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] { padding-right: 34px; }

/* =========================
   ===== Premium bits ======
   ========================= */

.ll-label-required { font-weight: 500; color: #c0392b; font-size: .85em; margin-left: 8px; }
.ll-label-premium  { font-style: italic; color: var(--ll-danger); font-size: .85em; margin-left: 8px; }

/* =========================
   ===== Media helpers =====
   ========================= */

.ll-img-64 {
  height: 64px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

/* Accessible visually-hidden file input */
.ll-file-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* =========================
   ==== Custom Upload Buttons ====
   ========================= */

/* Base style for all upload buttons */
.ll-upload-button {
  display: inline-block;
  background: var(--ll-accent);
  color: #fff;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  width: auto;              /* prevent full-width stretch */
  min-width: 150px;         /* reasonable base width */
  transition: background 0.2s ease;
}

.ll-upload-button:hover {
  background: var(--ll-accent-ink);
  color: #fff;              /* keep white text on hover */
}

/* Upload Logo button — extra specificity (if needed to override .ll-field label styles) */
.ll-field label.ll-upload-button[data-role="logo"] {
  color: #fff !important;   /* ensures label text stays white */
  justify-self: start;      /* aligns left in grid if applicable */
}


/* =========================
   ===== Motion safety =====
   ========================= */
@media (prefers-reduced-motion: reduce) {
  .ll-step,
  .ll-progress-indicator {
    transition: none !important;
    animation: none !important;
  }
}


/* Logo thumb + remove "×" */
.ll-logo-thumb {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}
.ll-logo-thumb img {
  height: 64px;
  width: auto;
  max-width: 100%;
  border-radius: 8px;
  display: block;
}
.ll-remove-logo {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #ccc;
  color: #333;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
  padding: 0;
}
.ll-remove-logo:hover {
  background: var(--ll-danger);
  border-color: var(--ll-danger);
  color: #fff;
}

/* Local Leader inline spinner — lightweight, self-contained */
.spinner,
.ll-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3); /* outer faint ring */
  border-top-color: #fff;                     /* active segment */
  border-radius: 50%;
  animation: llSpin 0.6s linear infinite;
  vertical-align: middle;
}

/* fallback for dark buttons */
.next-step.loading .spinner {
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: rgba(0, 0, 0, 0.6);
}

/* keep button slightly dimmed while loading */
.next-step.loading {
  opacity: 0.8;
  pointer-events: none;
}

/* spin animation */
@keyframes llSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Business form: make field help/description text smaller */
#ll-business-form .description {
  font-size: 1.4rem;     /* ~14px on a 16px base */
  line-height: 1.35;
  color: #6b7280;         /* subtle gray */
  margin-top: 6px;
}

/* (optional) make the little "(required)" and "Premium*" chips a touch smaller too */
#ll-business-form .ll-label-required,
#ll-business-form .ll-label-premium {
  font-size: 0.8em;
}

/* Step 0 fields layout (only fields, not the buttons) */
.ll-step-fields-step-0 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Default: fields span full width */
.ll-step-fields-step-0 .ll-field {
  grid-column: 1 / -1;
}

/* Products + Services become two columns */
.ll-step-fields-step-0 .ll-field-key-ll_products,
.ll-step-fields-step-0 .ll-field-key-ll_services {
  grid-column: span 1;
}

/* Mobile stack */
@media (max-width: 720px) {
  .ll-step-fields-step-0 { grid-template-columns: 1fr; }
  .ll-step-fields-step-0 .ll-field { grid-column: 1 / -1; }
}

/* Business form textarea sizing override (beats: form textarea {...}) */
#ll-business-form textarea {
  min-height: unset;      /* removes the 150px floor */
  line-height: 1.35;      /* optional: tighter */
  resize: vertical;       /* keep same UX */
}

/* If style.min.css loads after your CSS, use !important */
#ll-business-form textarea {
  min-height: 0 !important;
}
