/**
 * AI Easy Way - Lead Form Styles
 * Contact/Demo request form styling
 */

/* === Form Card Container === */
.form-card {
  max-width: 480px;
  margin: 40px auto 0;
  background: #eef0f3;
  border-radius: 24px;
  padding: 32px;
}

/* === Form Container === */
.lead-form {
  width: 100%;
}

.lead-form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-form-grid .form-group.full-width {
  width: 100%;
}

/* === Form Group === */
.form-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.form-label {
  font-family: 'Clash Display', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #0a0b0d;
  margin-bottom: 8px;
}

.form-label .required {
  color: #cf202f;
  margin-left: 2px;
}

/* === Input Fields === */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 16px 20px;
  background: #ffffff;
  border: none;
  border-radius: 100px;
  font-family: 'Clash Display', sans-serif;
  font-size: 16px;
  color: #0a0b0d;
  outline: none;
  transition: box-shadow 0.2s ease;
  text-align: center;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #7c828a;
}

.form-select {
  color: #7c828a;
}

.form-select:valid {
  color: #0a0b0d;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.15);
}

/* Error state */
.form-input.error,
.form-select.error,
.form-textarea.error {
  box-shadow: 0 0 0 2px #cf202f;
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(207, 32, 47, 0.2);
}

/* Success state */
.form-input.success,
.form-select.success,
.form-textarea.success {
  border-color: #05b169;
}

/* === Select Field === */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b616e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
  padding-right: 48px;
  cursor: pointer;
  text-align: center;
  text-align-last: center;
}

.form-select:invalid {
  color: #7c828a;
}

/* === Textarea === */
.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

/* === Checkbox / Privacy === */
.form-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #0052ff;
  cursor: pointer;
}

.form-checkbox-label {
  font-family: 'Clash Display', sans-serif;
  font-size: 14px;
  color: #5b616e;
  line-height: 1.4;
}

.form-checkbox-label a {
  color: #0052ff;
  text-decoration: underline;
}

.form-checkbox-label a:hover {
  color: #003ecc;
}

/* === Error Message === */
.form-error {
  display: none;
  font-family: 'Clash Display', sans-serif;
  font-size: 13px;
  color: #cf202f;
  margin-top: 4px;
}

.form-error.visible {
  display: block;
}

/* === Character Counter === */
.form-counter {
  font-family: 'Clash Display', sans-serif;
  font-size: 12px;
  color: #7c828a;
  text-align: right;
  margin-top: 4px;
}

.form-counter.warning {
  color: #f4b000;
}

.form-counter.error {
  color: #cf202f;
}

/* === Submit Button === */
.form-submit {
  margin-top: 20px;
}

.form-submit .btn {
  width: 100%;
  border-radius: 100px;
}

/* === Loading State === */
.btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn .loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Success State === */
.btn.btn-success {
  background: #05b169;
}

.btn.btn-success:hover {
  background: #05b169;
}

/* === Error State === */
.btn.btn-error {
  background: #cf202f;
}

.btn.btn-error:hover {
  background: #cf202f;
}

/* === Form Alert === */
.form-alert {
  padding: 14px 16px;
  border-radius: 12px;
  font-family: 'Clash Display', sans-serif;
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
}

.form-alert.visible {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-alert.success {
  background: #05b169;
  color: #ffffff;
}

.form-alert.error {
  background: #cf202f;
  color: #ffffff;
}

.form-alert svg {
  flex-shrink: 0;
}

/* === Responsive === */
@media (max-width: 640px) {
  .form-card {
    padding: 24px;
    margin: 32px auto 0;
  }

  .lead-form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 14px 16px;
  }

  .form-submit {
    margin-top: 20px;
  }
}
