/*
 * Titirimundi GDrive Uploader — form.css
 * Estilos autónomos: NO dependen de Elementor.
 * Selectores de alta especificidad para neutralizar el tema hello-elementor.
 */

/* ─── Contenedor ─────────────────────────────────────────────────────────────── */
#dfu-form {
  --c-border:       #d2d2d2;
  --c-focus:        #1a1a1a;
  --c-bg:           #ffffff;
  --c-placeholder:  #aaaaaa;
  --c-label:        #1a1a1a;
  --c-required:     #e0392b;
  --c-btn:          #e0392b;
  --c-btn-hover:    #c0312b;
  --r-input:        30px;
  --r-textarea:     8px;
  --r-btn:          30px;
  --shadow-input:   0 1px 4px rgba(0,0,0,0.07);
  font-family: Poppins, sans-serif;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 2rem 2.2rem;
  max-width: 620px;
  margin: 0 auto;
  box-shadow: 0 2px 14px rgba(0,0,0,0.06);
}

html body #dfu-form .elementor-form-fields-wrapper {
  display: block;
  margin: 0;
  padding: 0;
}

/* ─── Grupos de campo ───────────────────────────────────────────────────────── */
html body #dfu-form .elementor-field-group {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  padding: 0 !important;
  margin: 0 0 1rem 0 !important;
  box-sizing: border-box;
}

/* ─── Labels ─────────────────────────────────────────────────────────────────── */
html body #dfu-form label,
html body #dfu-form .elementor-field-label {
  display: block !important;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
  color: var(--c-label) !important;
  margin: 0 0 0.35rem 0 !important;
  padding: 0 !important;
  line-height: 1.4 !important;
  border: none !important;
  background: none !important;
}

html body #dfu-form .elementor-mark-required .elementor-field-label::after {
  content: ' *';
  color: var(--c-required);
}

/* ─── INPUTS — reset total del tema y re-aplicar estilos ───────────────────── */
html body #dfu-form input[type="text"],
html body #dfu-form input[type="email"],
html body #dfu-form input[type="tel"],
html body #dfu-form input[type="number"],
html body #dfu-form input.elementor-field {
  /* Reset del tema hello-elementor */
  -webkit-appearance: none !important;
  appearance: none !important;
  /* Bordes: full border pill, anulando border-bottom del tema */
  border-top: 1px solid var(--c-border) !important;
  border-right: 1px solid var(--c-border) !important;
  border-bottom: 1px solid var(--c-border) !important;
  border-left: 1px solid var(--c-border) !important;
  border-radius: var(--r-input) !important;
  /* Fondo y sombra */
  background: var(--c-bg) !important;
  background-color: var(--c-bg) !important;
  box-shadow: var(--shadow-input) !important;
  /* Dimensiones y espaciado */
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 0.6rem 1.2rem !important;
  /* Tipografía */
  font-family: Poppins, sans-serif !important;
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  color: var(--c-label) !important;
  line-height: 1.5 !important;
  /* Transición */
  transition: border-color 0.2s, box-shadow 0.2s !important;
  outline: none !important;
}

html body #dfu-form input[type="text"]:focus,
html body #dfu-form input[type="email"]:focus,
html body #dfu-form input[type="tel"]:focus,
html body #dfu-form input.elementor-field:focus {
  border-color: var(--c-focus) !important;
  box-shadow: 0 0 0 3px rgba(26,26,26,0.09) !important;
  outline: none !important;
}

html body #dfu-form input::placeholder {
  color: var(--c-placeholder) !important;
  opacity: 1 !important;
}

/* ─── TEXTAREA ─────────────────────────────────────────────────────────────── */
html body #dfu-form textarea,
html body #dfu-form textarea.elementor-field {
  -webkit-appearance: none !important;
  appearance: none !important;
  border-top: 1px solid var(--c-border) !important;
  border-right: 1px solid var(--c-border) !important;
  border-bottom: 1px solid var(--c-border) !important;
  border-left: 1px solid var(--c-border) !important;
  border-radius: var(--r-textarea) !important;
  background: var(--c-bg) !important;
  background-color: var(--c-bg) !important;
  box-shadow: var(--shadow-input) !important;
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 0.6rem 1rem !important;
  font-family: Poppins, sans-serif !important;
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  color: var(--c-label) !important;
  line-height: 1.5 !important;
  min-height: 120px !important;
  resize: vertical !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
  outline: none !important;
}

html body #dfu-form textarea:focus {
  border-color: var(--c-focus) !important;
  box-shadow: 0 0 0 3px rgba(26,26,26,0.09) !important;
  outline: none !important;
}

html body #dfu-form textarea::placeholder {
  color: var(--c-placeholder) !important;
  opacity: 1 !important;
}

/* ─── CHECKBOX ─────────────────────────────────────────────────────────────── */
html body #dfu-form .elementor-field-subgroup,
html body #dfu-form .elementor-field-option {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.5rem !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  color: var(--c-label) !important;
}

html body #dfu-form input[type="checkbox"] {
  -webkit-appearance: checkbox !important;
  appearance: checkbox !important;
  display: inline-block !important;
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  flex-shrink: 0 !important;
  margin: 0.2rem 0 0 0 !important;
  padding: 0 !important;
  border: 1px solid #999999 !important;
  border-radius: 3px !important;
  box-shadow: none !important;
  background: #ffffff !important;
  accent-color: var(--c-btn);
  cursor: pointer;
}

/* ─── BOTÓN ─────────────────────────────────────────────────────────────────── */
html body #dfu-form button,
html body #dfu-form .elementor-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.4rem !important;
  background: var(--c-btn) !important;
  background-color: var(--c-btn) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: var(--r-btn) !important;
  padding: 0.65rem 2rem !important;
  font-family: Poppins, sans-serif !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  cursor: pointer !important;
  text-decoration: none !important;
  box-shadow: none !important;
  min-width: 120px !important;
  transition: background 0.2s, transform 0.1s !important;
  margin-top: 0.5rem;
}

html body #dfu-form button:hover,
html body #dfu-form .elementor-button:hover {
  background: var(--c-btn-hover) !important;
  background-color: var(--c-btn-hover) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

html body #dfu-form .elementor-button-content-wrapper {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
}

/* ─── DROPZONE ───────────────────────────────────────────────────────────────── */
.dfu-dropzone {
  position: relative;
  border: 1px dashed #d0d0d0 !important;
  border-radius: 8px !important;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: #fafafa !important;
  box-shadow: none !important;
  transition: background 0.2s, border-color 0.2s;
}

.dfu-dropzone:hover,
.dfu-dropzone:focus,
.dfu-dropzone.is-over {
  background: #f0f0f0 !important;
  border-color: #1a1a1a !important;
  outline: none;
}

.dfu-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dfu-dropzone__icon {
  width: 2rem;
  margin: 0 auto 0.75rem;
  color: #767676;
}
.dfu-dropzone__icon svg { width: 100%; height: auto; }

.dfu-dropzone__text {
  margin: 0 0 0.3rem;
  font-size: 0.92rem;
  color: #1a1a1a;
}

.dfu-dropzone__link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dfu-dropzone__hint {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: #767676;
}

/* ─── Lista de archivos ──────────────────────────────────────────────────────── */
.dfu-file-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dfu-file-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.83rem;
  padding: 0.35rem 0.7rem;
  background: #f0f0f0;
  border-radius: 4px;
}

.dfu-file-list__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.dfu-file-list__size {
  color: #767676;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

/* ─── Progreso ───────────────────────────────────────────────────────────────── */
.dfu-progress-wrap { display: none; flex-direction: column; gap: 0.35rem; margin-bottom: 0.75rem; }
.dfu-progress-wrap.is-visible { display: flex; }
.dfu-progress-label { font-size: 0.83rem; color: #767676; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dfu-progress-track { width: 100%; height: 3px; background: #e0e0e0; border-radius: 3px; overflow: hidden; }
.dfu-progress-bar { height: 100%; background: #e0392b; border-radius: 3px; transition: width 0.15s linear; }
.dfu-progress-pct { font-size: 0.78rem; color: #767676; text-align: right; }

/* ─── Spinner ────────────────────────────────────────────────────────────────── */
.dfu-btn__spinner {
  display: none;
  width: 0.85rem; height: 0.85rem;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: dfu-spin 0.7s linear infinite;
}
#dfu-btn.is-loading .dfu-btn__spinner { display: inline-block; }
@keyframes dfu-spin { to { transform: rotate(360deg); } }

/* ─── Mensaje ────────────────────────────────────────────────────────────────── */
.dfu-msg { font-size: 0.9rem; line-height: 1.5; min-height: 1.2rem; margin-top: 0.5rem; }
.dfu-msg.is-error   { color: #c0392b; }
.dfu-msg.is-success { color: #27ae60; }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #dfu-form { padding: 1.25rem 1.1rem; border-radius: 8px; }
  html body #dfu-form button,
  html body #dfu-form .elementor-button { width: 100%; justify-content: center; }
}
