/* NegocioGo — subida de archivos y widgets de formulario (Turnstile) */

.file-upload {
  display: grid;
  gap: 8px;
}

.file-upload__label {
  font-weight: 700;
  font-size: 0.875rem;
  color: #0f172a;
  line-height: 1.35;
}

.file-upload__optional,
.file-upload__required {
  font-weight: 600;
  color: #64748b;
}

.file-upload__required {
  color: #dc2626;
}

.file-upload__help {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #64748b;
}

.file-upload__dropzone {
  position: relative;
  border: 1.5px dashed #cbd5e1;
  border-radius: 18px;
  background: #f8fafc;
  padding: 22px 18px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.file-upload__dropzone:hover,
.file-upload__dropzone:focus-within {
  border-color: #068C61;
  background: #F3FFFA;
  box-shadow: 0 12px 28px rgba(14, 143, 102, 0.08);
}

.file-upload__dropzone.is-dragover {
  border-color: #068C61;
  background: #ecfdf5;
}

.file-upload__dropzone.has-file .file-upload__content {
  display: none;
}

.file-upload__dropzone.has-file .file-upload__selected {
  display: flex;
}

.file-upload__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-upload__dropzone.has-file .file-upload__input {
  pointer-events: none;
}

.file-upload__content {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 6px;
  color: #475569;
  pointer-events: none;
}

.file-upload__content strong {
  color: #0f172a;
  font-size: 0.9375rem;
}

.file-upload__content span {
  font-size: 0.8125rem;
  line-height: 1.45;
  max-width: 22rem;
}

.file-upload__content small {
  color: #94a3b8;
  font-size: 0.75rem;
}

.file-upload__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #068C61;
  background: #E9FFF7;
}

.file-upload__selected {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.file-upload__selected-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-upload__selected-copy {
  min-width: 0;
}

.file-upload__selected-copy strong {
  display: block;
  font-size: 0.875rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 14rem;
}

.file-upload__selected-copy small {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
}

.file-upload__thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f1f5f9;
}

.file-upload__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.file-upload__file-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f1f5f9;
  color: #475569;
  flex-shrink: 0;
}

.file-upload__selected-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.file-upload__btn {
  border: 0;
  background: #f1f5f9;
  color: #0f172a;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
  transition: background 0.15s ease;
}

.file-upload__btn:hover {
  background: #e2e8f0;
}

.file-upload__btn:focus-visible {
  outline: 2px solid #068C61;
  outline-offset: 2px;
}

.file-upload__btn--remove {
  color: #b91c1c;
}

.file-upload__current {
  margin: 0;
  font-size: 0.8125rem;
}

.file-upload__current a {
  color: #068C61;
  font-weight: 600;
  text-decoration: none;
}

.file-upload__current a:hover {
  text-decoration: underline;
}

.file-upload__error {
  margin: 0;
  font-size: 0.8125rem;
  color: #b91c1c;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.file-upload__error[hidden] {
  display: none !important;
}

.file-upload__error.is-server::before {
  content: none;
}

.file-upload__pending {
  margin: 0;
  font-size: 0.8125rem;
  color: #056947;
  font-weight: 600;
}

.file-upload__pending[hidden] {
  display: none !important;
}

/* Variante marca (logo / portada) */
.file-upload--brand .file-upload__brand-layout {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .file-upload--brand .file-upload__brand-layout {
    grid-template-columns: auto 1fr;
    align-items: start;
  }
}

.file-upload__brand-preview {
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.file-upload--brand-logo .file-upload__brand-preview {
  width: 112px;
  height: 112px;
}

.file-upload--brand-banner .file-upload__brand-preview {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 16 / 6;
}

.file-upload__brand-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.file-upload__brand-placeholder {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 1rem;
  color: #94a3b8;
  font-size: 0.75rem;
  text-align: center;
}

.file-upload__brand-remove {
  justify-self: start;
  margin-top: 4px;
}

.file-upload.is-pending .file-upload__dropzone {
  border-color: #86efac;
  background: #F3FFFA;
}

/* Variante compacta (formularios densos) */
.file-upload--compact .file-upload__dropzone {
  padding: 16px 14px;
}

.file-upload--compact .file-upload__icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

/* Avatar (perfil cliente) */
.file-upload--avatar {
  gap: 0;
}

.file-upload--avatar .file-upload__dropzone {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.file-upload--avatar .file-upload__dropzone:hover,
.file-upload--avatar .file-upload__dropzone:focus-within {
  box-shadow: none;
  background: transparent;
}

.file-upload--avatar .file-upload__content {
  display: none;
}

.file-upload--avatar .file-upload__input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
}

/* Cloudflare Turnstile */
.turnstile-card,
.turnstile-widget-wrap {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 10px 12px;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
  box-sizing: border-box;
}

.turnstile-card .cf-turnstile,
.turnstile-widget-wrap .cf-turnstile {
  max-width: 100%;
}

.turnstile-card__hint,
.turnstile-card__error {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #64748b;
}

.turnstile-card__error {
  color: #b91c1c;
}

.turnstile-card__error[hidden],
.turnstile-card__hint[hidden] {
  display: none !important;
}

.turnstile-card.is-error {
  border-color: #fecaca;
  background: #fef2f2;
}

/* Compatibilidad con upload-zone legado */
.upload-zone {
  position: relative;
  border: 1.5px dashed #cbd5e1;
  border-radius: 18px;
  background: #f8fafc;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.upload-zone.is-drag,
.upload-zone.is-dragover,
.upload-zone:hover {
  border-color: #068C61;
  background: #F3FFFA;
}

.upload-zone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.upload-zone-body {
  padding: 2rem 1.25rem;
  text-align: center;
  pointer-events: none;
}

.upload-zone-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.75rem;
  border-radius: 14px;
  background: #E9FFF7;
  display: grid;
  place-items: center;
  color: #068C61;
}

.upload-zone-title {
  font-weight: 700;
  font-size: 0.9375rem;
  color: #0f172a;
}

.upload-zone-hint {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.35rem;
}

@media (max-width: 480px) {
  .file-upload__selected {
    flex-direction: column;
    align-items: stretch;
  }

  .file-upload__selected-actions {
    justify-content: stretch;
  }

  .file-upload__selected-actions .file-upload__btn {
    flex: 1;
    justify-content: center;
  }

  .file-upload__selected-copy strong {
    max-width: 100%;
  }

  .turnstile-card,
  .turnstile-widget-wrap {
    width: 100%;
  }
}
