/*
 * ExpoClean - Registro de Comerciantes
 * Stylesheet: Form styles compatible with the Astra theme.
 *
 * Relies on Astra's CSS custom properties (--ast-global-color-*, etc.)
 * where available, with sensible fallbacks for other themes.
 */

/* =========================================================
   1. WRAPPER
   ========================================================= */
.expo-registration-wrap {
  max-width: 860px;
  margin: 0 auto;
  font-family: inherit; /* Inherits Astra's body font */
}

/* =========================================================
   2. SECTION CARDS
   ========================================================= */
.expo-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 28px 32px;
  margin-bottom: 28px;
}

.expo-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ast-global-color-0, #004bb4);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ast-global-color-0, #004bb4);
  letter-spacing: 0.02em;
}

/* =========================================================
   3. FIELD GRID
   ========================================================= */
.expo-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  margin-bottom: 16px;
}

.expo-field-row.full {
  grid-template-columns: 1fr;
}

.expo-field-row.thirds {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 640px) {
  .expo-section {
    padding: 20px 16px;
  }

  .expo-field-row,
  .expo-field-row.thirds {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   4. FORM CONTROLS
   ========================================================= */
.expo-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.expo-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
}

.expo-field label .expo-required {
  color: #e53e3e;
  margin-left: 2px;
}

.expo-field input[type="text"],
.expo-field input[type="email"],
.expo-field input[type="tel"],
.expo-field input[type="url"],
.expo-field select,
.expo-field textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #111827;
  background: #f9fafb;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

.expo-field input:focus,
.expo-field select:focus,
.expo-field textarea:focus {
  outline: none;
  border-color: var(--ast-global-color-0, #004bb4);
  box-shadow: 0 0 0 3px rgba(0, 75, 180, 0.12);
  background: #fff;
}

.expo-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='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.expo-field textarea {
  min-height: 75px;
  resize: vertical;
}

/* Checkbox field */
.expo-field-checkbox {
  flex-direction: row;
  align-items: center;
}

.expo-field-checkbox input[type="checkbox"] {
  width: auto;
  appearance: checkbox;
  -webkit-appearance: checkbox;
}

.expo-field-checkbox label {
  font-size: 0.95rem; /* Increased from default */
  font-weight: 500;
}

/* Validation states */
.expo-field input.expo-error,
.expo-field select.expo-error,
.expo-field textarea.expo-error {
  border-color: #e53e3e;
  background: #fff5f5;
}

.expo-field .expo-field-error {
  font-size: 0.78rem;
  color: #e53e3e;
  margin-top: 2px;
}

/* RIF inline group */
.expo-rif-group {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.expo-rif-group select {
  width: 90px;
  flex-shrink: 0;
}

.expo-rif-group input {
  flex: 1;
}

.expo-rif-group .expo-btn-validate {
  flex-shrink: 0;
  white-space: nowrap;
  align-self: flex-start;
}

/* RIF status badge */
#expo-rif-status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
}

#expo-rif-status.validated {
  background: #d1fae5;
  color: #065f46;
}

#expo-rif-status.invalid {
  background: #fee2e2;
  color: #7f1d1d;
}

#expo-rif-status.checking {
  background: #fef3c7;
  color: #78350f;
}

/* =========================================================
   5. ATTENDEES SECTION
   ========================================================= */
.expo-attendee-block {
  border: 1px dashed #d1d5db;
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 16px;
  position: relative;
  background: #f9fafb;
}

.expo-attendee-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 14px;
}

.expo-btn-remove-attendee {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: #e53e3e;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.expo-btn-remove-attendee:hover {
  color: #9b1c1c;
}

/* =========================================================
   6. BUTTONS
   ========================================================= */
.expo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition:
    background 0.2s,
    opacity 0.2s;
  text-decoration: none;
}

.expo-btn-primary,
.expo-btn-secondary {
  background: var(--ast-global-color-0, #004bb4);
  color: #fff;
  border: none;
}

.expo-btn-primary:hover,
.expo-btn-secondary:hover {
  background: #003a8c;
  color: #fff;
  border: none;
  opacity: 1;
}

.expo-btn-validate {
  background: #004bb4;
  color: #fff;
  padding: 9px 14px;
  font-size: 0.85rem;
}

.expo-btn-validate:hover {
  background: #003a8c;
}

.expo-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.expo-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 8px;
}

/* =========================================================
   7. NOTICES
   ========================================================= */
.expo-notice {
  padding: 14px 18px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 0.92rem;
  display: none; /* shown via JS */
}

.expo-notice.success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid #059669;
  display: block;
}

.expo-notice.error {
  background: #fee2e2;
  color: #7f1d1d;
  border-left: 4px solid #e53e3e;
  display: block;
}

/* =========================================================
   8. SPINNER
   ========================================================= */
.expo-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: expo-spin 0.7s linear infinite;
}

@keyframes expo-spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================
   9. TABS (Register / Edit)
   ========================================================= */
.expo-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  border-bottom: 2px solid #e5e7eb;
}

.expo-tab-btn {
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition:
    color 0.2s,
    border-color 0.2s;
}

.expo-tab-btn:hover {
  color: #fff;
  background-color: var(--ast-global-color-0, #004bb4);
  border-radius: 6px 6px 0 0;
}

.expo-tab-btn.active {
  color: #fff;
  border-bottom-color: transparent;
  background-color: var(--ast-global-color-0, #004bb4);
}

.expo-tabs .expo-tab-btn.active {
  background-color: #004bb4; /* Azul Real */
  border-color: #004bb4;
  color: #fff; /* Blanco */
  border-radius: 6px 6px 0 0;
}

.expo-tabs .expo-tab-btn.active:hover {
  background-color: #003a8c;
  border-color: #003a8c;
}

.expo-tab-panel {
  display: none;
}

.expo-tab-panel.active {
  display: block;
}

/* =========================================================
   10. EDIT MODE — RIF lookup box
   ========================================================= */
.expo-lookup-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 24px;
}

.expo-lookup-box p {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 14px;
}

/* RIF readonly styling */
input[readonly] {
  background: #f3f4f6 !important;
  cursor: not-allowed;
  color: #6b7280;
}

/* Document already uploaded badge */
.expo-doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #065f46;
  background: #d1fae5;
  padding: 4px 10px;
  border-radius: 4px;
  margin-top: 4px;
}
