/* ═══════════════════════════════════════════════
   LD Auth Registro — Estilos v2
   Compatible con LMSmart + Elementor
   Neutraliza <p>/<br> inyectados por Elementor
═══════════════════════════════════════════════ */

:root {
  --ldar-primary:       #aa2b1d;
  --ldar-primary-hover: #8a2218;
  --ldar-success:       #16a34a;
  --ldar-error:         #dc2626;
  --ldar-warning:       #d97706;
  --ldar-info:          #0284c7;
  --ldar-radius:        10px;
  --ldar-border:        #d1d5db;
  --ldar-bg:            #ffffff;
  --ldar-text:          #111827;
  --ldar-muted:         #6b7280;
  --ldar-input-bg:      #f9fafb;
  --ldar-shadow:        0 4px 32px rgba(0,0,0,.08);
  --ldar-font:          inherit;
  --ldar-transition:    .18s ease;
}

/* ═══════════════════════════════════════════════
   NUCLEAR RESET — Eliminar <p>, <br> de Elementor
   Estos tags inyectados son los que rompen el layout
═══════════════════════════════════════════════ */
.ldar-wrapper p,
.ldar-wrapper br,
.ldar-card p,
.ldar-card br,
.ldar-form p,
.ldar-form br,
.ldar-field p,
.ldar-field br,
.ldar-row p,
.ldar-row br,
.ldar-input-group p,
.ldar-input-group br,
.ldar-card__header p:empty,
.ldar-card__body > p,
.ldar-select-wrapper br,
.ldar-strength p,
.ldar-label br,
.ldar-label p {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  height: 0 !important;
}

/* Restaurar los <p> que SÍ necesitamos */
.ldar-card__subtitle,
.ldar-switch,
.ldar-alert p,
.ldar-alert__msg p {
  display: block !important;
  font-size: inherit !important;
  line-height: inherit !important;
  height: auto !important;
}

/* Restaurar <p> que Elementor usa para envolver botón, checkbox y otros elementos visibles */
.ldar-form > p,
.ldar-card__body > p {
  display: contents !important;
  font-size: inherit !important;
  line-height: inherit !important;
  height: auto !important;
}

/* ═══════════════════════════════════════════════
   Elementor widget overrides
═══════════════════════════════════════════════ */
.elementor-widget-text-editor .ldar-wrapper,
.elementor-widget-shortcode .ldar-wrapper {
  font-size: 14px;
  line-height: 1.5;
}

.elementor-widget-text-editor .ldar-card,
.elementor-widget-shortcode .ldar-card {
  text-align: left;
}

/* ── Wrapper ── */
.ldar-wrapper {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 0;
  font-family: var(--ldar-font);
  box-sizing: border-box;
}

.ldar-wrapper--registro {
  max-width: 560px;
}

.ldar-wrapper *,
.ldar-wrapper *::before,
.ldar-wrapper *::after {
  box-sizing: border-box;
}

/* ── Card ── */
.ldar-card {
  background: var(--ldar-bg);
  border-radius: var(--ldar-radius);
  box-shadow: var(--ldar-shadow);
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.ldar-card__header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid #f3f4f6;
}

.ldar-card__title {
  margin: 0 0 4px !important;
  padding: 0 !important;
  font-size: 20px !important;
  font-weight: 700;
  color: var(--ldar-text);
  line-height: 1.2 !important;
}

.ldar-card__subtitle {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 13px !important;
  color: var(--ldar-muted);
  line-height: 1.4 !important;
}

.ldar-card__body {
  padding: 20px 28px 28px;
}

/* ── Form ── */
.ldar-form {
  display: flex !important;
  flex-direction: column;
  gap: 14px;
}

.ldar-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ldar-field {
  display: flex !important;
  flex-direction: column;
  gap: 4px;
}

.ldar-label {
  display: inline !important;
  font-size: 12.5px !important;
  font-weight: 600;
  color: var(--ldar-text);
  letter-spacing: .01em;
  line-height: 1.3 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ldar-required {
  color: var(--ldar-error);
  margin-left: 1px;
}

/* ── Inputs ── */
.ldar-input {
  width: 100%;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: var(--ldar-font);
  color: var(--ldar-text);
  background: var(--ldar-input-bg);
  border: 1px solid var(--ldar-border);
  border-radius: calc(var(--ldar-radius) - 2px);
  outline: none;
  transition: border-color var(--ldar-transition), box-shadow var(--ldar-transition);
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  margin: 0 !important;
  line-height: 1.4 !important;
}

.ldar-input:focus {
  border-color: var(--ldar-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.ldar-input::placeholder {
  color: #9ca3af;
}

.ldar-input:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* ── Input group (toggle password) ── */
.ldar-input-group {
  position: relative;
  display: flex !important;
  align-items: center;
}

.ldar-input-group .ldar-input {
  padding-right: 38px;
}

.ldar-toggle-pass {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 36px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: var(--ldar-muted);
  padding: 0;
  margin: 0;
  transition: color var(--ldar-transition);
}

.ldar-toggle-pass:hover {
  color: var(--ldar-primary);
}

.ldar-eye {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Select ── */
.ldar-select-wrapper {
  position: relative;
}

.ldar-select-wrapper .select__field {
  display: block;
}

.ldar-select {
  cursor: pointer;
  padding-right: 32px;
}

.ldar-select-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--ldar-muted);
  font-size: 14px;
  line-height: 1;
}

/* ── Password strength ── */
.ldar-strength {
  margin-top: 4px;
  display: flex !important;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity .2s;
  height: auto !important;
}

.ldar-strength.visible {
  opacity: 1;
}

.ldar-strength__bar {
  flex: 1;
  height: 3px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.ldar-strength__bar::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 99px;
  transition: width .3s, background .3s;
  width: var(--strength-pct, 0%);
  background: var(--strength-color, #e5e7eb);
}

.ldar-strength__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--strength-color, var(--ldar-muted));
  white-space: nowrap;
  display: inline !important;
}

/* ── Checkbox ── */
.ldar-checkbox {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ldar-muted);
  line-height: 1.4;
}

.ldar-checkbox input[type="checkbox"] {
  margin: 2px 0 0 0;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--ldar-primary);
  cursor: pointer;
}

/* ── Remember / forgot ── */
.ldar-field--remember {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ── Buttons ── */
.ldar-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--ldar-font);
  border: 2px solid transparent;
  border-radius: var(--ldar-radius);
  cursor: pointer;
  transition: background var(--ldar-transition), transform var(--ldar-transition), box-shadow var(--ldar-transition);
  text-decoration: none;
  outline: none;
  user-select: none;
  line-height: 1.3 !important;
  margin: 4px 0 0 0 !important;
}

.ldar-btn--primary {
  background: var(--ldar-primary);
  color: #ffffff !important;
}

.ldar-btn--primary:hover:not(:disabled) {
  background: var(--ldar-primary-hover);
  box-shadow: 0 4px 14px rgba(37, 99, 235, .30);
  transform: translateY(-1px);
  color: #ffffff !important;
}

.ldar-btn--primary:active {
  transform: translateY(0);
}

.ldar-btn--full {
  width: 100%;
}

.ldar-btn:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
}

/* ── Spinner ── */
.ldar-spinner {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  animation: ldar-spin .75s linear infinite;
}

@keyframes ldar-spin {
  to { transform: rotate(360deg); }
}

/* ── Alerts ── */
.ldar-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: calc(var(--ldar-radius) - 2px);
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 12px 0 !important;
}

.ldar-alert__icon {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.ldar-alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.ldar-alert--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #14532d;
}

.ldar-alert--info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}

.ldar-alert--warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
}

/* ── Links ── */
.ldar-link {
  color: var(--ldar-primary) !important;
  text-decoration: none;
  font-weight: 600;
  transition: opacity var(--ldar-transition);
}

.ldar-link:hover {
  opacity: .75;
  text-decoration: underline;
}

.ldar-link--forgot {
  font-size: 12.5px;
  font-weight: 500;
}

/* ── Switch (¿Ya tienes cuenta?) ── */
.ldar-switch {
  text-align: center;
  margin: 14px 0 0 0 !important;
  padding: 0 !important;
  font-size: 12.5px !important;
  color: var(--ldar-muted);
  line-height: 1.4 !important;
}

/* ── Hidden inputs ── */
.ldar-form input[type="hidden"] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  border: 0 !important;
}

/* ═══════════════════════════════════════════════
   Responsive
═══════════════════════════════════════════════ */
@media (max-width: 540px) {
  .ldar-wrapper {
    padding: 0 8px;
  }

  .ldar-card__header {
    padding: 18px 18px 14px;
  }

  .ldar-card__body {
    padding: 16px 18px 22px;
  }

  .ldar-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .ldar-field--remember {
    flex-direction: column;
    align-items: flex-start;
  }

  .ldar-card__title {
    font-size: 18px !important;
  }
}
