/* ========================================
   SHARED FORM STYLES
   Analytic Endeavors - Reusable form components
   ======================================== */

/* Form wrapper */
.ae-form-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* Legacy alias */
.ae-hubspot-form-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ========================================
   HONEYPOT (Spam Prevention)
   ======================================== */

.ae-hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

/* ========================================
   FORM FIELDS
   ======================================== */

.form-field {
  margin-bottom: 20px;
}

.form-field label {
  display: block;
  color: #ffffff;
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 6px;
}

.form-field .required {
  color: #ff6b6b;
}

.form-field input,
.form-field textarea,
.form-field select {
  background: #1a1a2e;
  border: 1px solid #2a3a5a;
  color: #ffffff;
  border-radius: 8px;
  padding: 12px;
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: #00B8B8;
  box-shadow: 0 0 0 3px rgba(0, 184, 184, 0.15);
  outline: none;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #707080;
}

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

/* Larger textarea variant */
.form-field textarea.textarea-lg {
  min-height: 150px;
}

/* ========================================
   SELECT DROPDOWN
   ======================================== */

.form-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23707080' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-field select option {
  background: #1a1a2e;
  color: #ffffff;
}

/* ========================================
   DATE INPUT
   ======================================== */

.form-field input[type="date"] {
  cursor: pointer;
}

.form-field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

/* ========================================
   RADIO GROUP
   ======================================== */

.radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #b0b0c0;
  font-size: 15px;
  padding: 10px 16px;
  background: #1a1a2e;
  border: 1px solid #2a3a5a;
  border-radius: 8px;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.radio-label:hover {
  border-color: #00B8B8;
}

.radio-label input[type="radio"] {
  width: auto;
  accent-color: #009999;
  cursor: pointer;
}

.radio-label input[type="radio"]:checked + .radio-text {
  color: #ffffff;
}

.radio-label:has(input:checked) {
  border-color: #00B8B8;
  background: rgba(0, 184, 184, 0.08);
}

/* ========================================
   FORM LAYOUT
   ======================================== */

/* Side-by-side row */
.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-field {
  flex: 1;
}

/* Actions row (checkbox + submit) */
.form-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 24px;
  gap: 16px;
}

/* ========================================
   CHECKBOX
   ======================================== */

.form-checkbox {
  margin: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #b0b0c0;
  font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #009999;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-text {
  user-select: none;
}

/* ========================================
   HELPER TEXT
   ======================================== */

.form-helper {
  color: #707080;
  font-size: 13px;
  margin-bottom: 6px;
}

/* ========================================
   SUBMIT BUTTON
   ======================================== */

.form-submit {
  flex-shrink: 0;
}

.form-submit button {
  background: linear-gradient(135deg, #009999 0%, #00B8B8 100%);
  color: #ffffff;
  border: none;
  border-radius: 39px;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 153, 153, 0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.025em;
  font-family: inherit;
}

.form-submit button:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 153, 153, 0.5);
}

.form-submit button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Submit button shimmer */
@keyframes ae-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.form-submit button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.form-submit button:hover:not(:disabled)::before {
  left: 100%;
}

/* ========================================
   FORM MESSAGES
   ======================================== */

.form-message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}

.form-error {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: #ff6b6b;
}

/* ========================================
   SUCCESS STATE
   ======================================== */

.form-success {
  text-align: center;
  padding: 60px 20px;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: rgba(0, 184, 184, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--teal-light, #00B8B8);
}

.form-success h3 {
  font-size: 1.5rem;
  color: var(--text-primary, #ffffff);
  margin-bottom: 8px;
}

.form-success p {
  color: var(--text-secondary, #a0a0b0);
  font-size: 1rem;
}

/* ========================================
   LIGHT MODE OVERRIDES
   ======================================== */

[data-theme="light"] .form-field label {
  color: #1a1a2e;
}

[data-theme="light"] .form-field .required {
  color: #dc2626;
}

[data-theme="light"] .form-field input,
[data-theme="light"] .form-field textarea,
[data-theme="light"] .form-field select {
  background: #ffffff;
  border: 1px solid #d0d5dd;
  color: #1a1a2e;
}

[data-theme="light"] .form-field input::placeholder,
[data-theme="light"] .form-field textarea::placeholder {
  color: #9ca3af;
}

[data-theme="light"] .form-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

[data-theme="light"] .form-field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: none;
}

[data-theme="light"] .radio-label {
  background: #ffffff;
  border-color: #d0d5dd;
  color: #4a5568;
}

[data-theme="light"] .radio-label:hover {
  border-color: #009090;
}

[data-theme="light"] .radio-label:has(input:checked) {
  border-color: #009090;
  background: rgba(0, 119, 119, 0.06);
}

[data-theme="light"] .radio-label input[type="radio"]:checked + .radio-text {
  color: #1a1a2e;
}

[data-theme="light"] .form-error {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
  color: #dc2626;
}

[data-theme="light"] .checkbox-label {
  color: #4a5568;
}

[data-theme="light"] .form-helper {
  color: #6b7280;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .ae-form-wrapper,
  .ae-hubspot-form-wrapper {
    padding: 0 16px 60px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .radio-group {
    flex-direction: column;
    gap: 8px;
  }
}
