/**
 * Digalco Registration Experience - Modernized B2B & Individual Styling
 * 
 * Visual hierarchy and design tokens strictly aligned with Digalco's modernized
 * design system (/distribucion-informatica/, /servicios/, /alquiler-de-equipos/).
 *
 * Replaces stacked cardification with an elevated unified surface, refined section
 * typography, modern Digalco primary CTA, and responsive two-column grid.
 *
 * @package Digalco_Business_Tools
 */

:root {
  --dbt-primary: #1a73e8;
  --dbt-primary-hover: #1557b0;
  --dbt-primary-soft: rgba(26, 115, 232, 0.08);
  --dbt-primary-glow: rgba(26, 115, 232, 0.25);

  --dbt-dark-900: #0a1b29;
  --dbt-dark-800: #12283d;
  --dbt-text-main: #0a1b29;
  --dbt-text-muted: #51606d;
  --dbt-text-subtle: #8492a6;

  --dbt-surface: #ffffff;
  --dbt-surface-alt: #f4f7fa;
  --dbt-border-soft: #d8e1ea;
  --dbt-border-light: #e6edf4;

  --dbt-success-bg: #dcfce7;
  --dbt-success-text: #166534;
  --dbt-info-bg: #e0f2fe;
  --dbt-info-text: #0369a1;
  --dbt-warning-bg: #fef3c7;
  --dbt-warning-text: #92400e;

  --dbt-radius-sm: 8px;
  --dbt-radius-md: 12px;
  --dbt-radius-lg: 16px;
  --dbt-radius-pill: 9999px;

  --dbt-shadow-surface: 0 4px 24px rgba(10, 27, 41, 0.05);
  --dbt-shadow-btn: 0 4px 16px rgba(26, 115, 232, 0.32);
  --dbt-shadow-btn-hover: 0 6px 22px rgba(26, 115, 232, 0.42);

  --dbt-transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* -------------------------------------------------------------
   Container & Global Layout (Spacious Desktop Container)
------------------------------------------------------------- */
.dbt-registration-wrapper {
  max-width: 960px;
  margin: 1.5rem auto 4rem;
  width: 100%;
  color: var(--dbt-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* -------------------------------------------------------------
   Hero Header: Clean Semantic H1 & Kicker Badge
------------------------------------------------------------- */
.dbt-reg-hero {
  margin-bottom: 1.75rem;
  text-align: left;
}

.dbt-reg-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--dbt-primary-soft);
  color: var(--dbt-primary);
  border-radius: var(--dbt-radius-pill);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.dbt-reg-kicker .dbt-icon {
  color: var(--dbt-primary);
  flex-shrink: 0;
}

.dbt-reg-title {
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  font-weight: 750;
  color: var(--dbt-dark-900);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 0.65rem 0;
}

.dbt-reg-subtitle {
  font-size: 1.05rem;
  color: var(--dbt-text-muted);
  line-height: 1.6;
  max-width: 65ch;
  margin: 0;
}

/* -------------------------------------------------------------
   Cross-Flow Switch Callout (Lighter, Sober Banner)
------------------------------------------------------------- */
.dbt-registration-switch-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.15rem 1.4rem;
  background: var(--dbt-surface-alt);
  border: 1px solid var(--dbt-border-soft);
  border-left: 4px solid var(--dbt-primary);
  border-radius: var(--dbt-radius-md);
  margin-bottom: 2.25rem;
  font-size: 0.925rem;
  box-shadow: 0 1px 3px rgba(10, 27, 41, 0.03);
}

.dbt-switch-content {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.dbt-switch-icon {
  color: var(--dbt-primary);
  flex-shrink: 0;
}

.dbt-switch-text {
  color: var(--dbt-text-main);
  font-size: 0.925rem;
}

.dbt-switch-text-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dbt-switch-text-group strong {
  color: var(--dbt-text-main);
  font-size: 0.95rem;
  font-weight: 650;
}

.dbt-switch-text-group span {
  color: var(--dbt-text-muted);
  font-size: 0.875rem;
}

.dbt-switch-action {
  white-space: nowrap;
  font-weight: 650;
  font-size: 0.925rem;
  color: var(--dbt-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--dbt-transition);
  padding: 0.4rem 0.75rem;
  border-radius: var(--dbt-radius-sm);
  background: rgba(26, 115, 232, 0.05);
}

.dbt-switch-action:hover {
  color: var(--dbt-primary-hover);
  background: rgba(26, 115, 232, 0.12);
  text-decoration: none;
}

.dbt-switch-action svg {
  transition: transform var(--dbt-transition);
}

.dbt-switch-action:hover svg {
  transform: translateX(3px);
}

/* -------------------------------------------------------------
   Unified Form Surface (Replaces Stacked Mini-Cards)
------------------------------------------------------------- */
.dbt-registration-form-surface {
  background: var(--dbt-surface);
  border: 1px solid var(--dbt-border-light);
  border-radius: var(--dbt-radius-lg);
  box-shadow: var(--dbt-shadow-surface);
  padding: 2.75rem 3rem;
}

/* -------------------------------------------------------------
   Semantic Section Groups & Clear Dividers
------------------------------------------------------------- */
.dbt-reg-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--dbt-border-light);
}

.dbt-reg-section:last-of-type,
.dbt-reg-section.dbt-section-consent {
  margin-bottom: 1.5rem;
  padding-bottom: 0;
  border-bottom: none;
}

.dbt-section-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.dbt-section-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--dbt-radius-sm);
  background: var(--dbt-primary-soft);
  color: var(--dbt-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.dbt-section-title-group {
  display: flex;
  flex-direction: column;
}

.dbt-section-title {
  font-size: 1.18rem !important;
  font-weight: 700 !important;
  color: var(--dbt-dark-900) !important;
  line-height: 1.3 !important;
  margin: 0 !important;
  letter-spacing: -0.01em;
}

.dbt-section-desc {
  font-size: 0.865rem;
  color: var(--dbt-text-muted);
  line-height: 1.45;
  margin: 0.25rem 0 0 0 !important;
}

/* -------------------------------------------------------------
   Customer Type Interactive Selector (Polished Radio Cards)
------------------------------------------------------------- */
.dbt-customer-type-selector {
  margin-bottom: 1.25rem;
}

.dbt-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}

.dbt-type-card {
  position: relative;
  background: var(--dbt-surface);
  border: 2px solid var(--dbt-border-soft);
  border-radius: var(--dbt-radius-md);
  padding: 1.35rem 1.45rem;
  cursor: pointer;
  transition: all var(--dbt-transition);
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.dbt-type-card:hover {
  border-color: #b8c9db;
  background: #fafcff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(10, 27, 41, 0.05);
}

.dbt-type-card.is-selected {
  border-color: var(--dbt-primary);
  background: #f0f7ff;
  box-shadow: 0 0 0 1px var(--dbt-primary), 0 8px 24px rgba(26, 115, 232, 0.12);
}

.dbt-type-card input[type="radio"] {
  position: absolute;
  top: 1.35rem;
  right: 1.35rem;
  accent-color: var(--dbt-primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.dbt-type-card-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  padding-right: 2rem;
}

.dbt-type-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dbt-dark-900);
  line-height: 1.3;
}

.dbt-type-card-title .dbt-icon {
  color: var(--dbt-primary);
  flex-shrink: 0;
}

.dbt-type-card-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--dbt-radius-pill);
}

.dbt-type-card-badge.badge-instant {
  background: var(--dbt-success-bg);
  color: var(--dbt-success-text);
}

.dbt-type-card-badge.badge-review {
  background: var(--dbt-info-bg);
  color: var(--dbt-info-text);
}

.dbt-type-card-desc {
  font-size: 0.865rem;
  color: var(--dbt-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Feedback notice banner for selected customer type */
.dbt-type-feedback-notice {
  margin-top: 1.15rem;
  padding: 0.95rem 1.25rem;
  border-radius: var(--dbt-radius-sm);
  font-size: 0.875rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.dbt-type-feedback-notice .dbt-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.dbt-type-feedback-notice.notice-instant {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.dbt-type-feedback-notice.notice-review {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
}

/* -------------------------------------------------------------
   12-Column Responsive Field Grid System & Input Styling
------------------------------------------------------------- */
.dbt-grid-12,
.dbt-fields-grid {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  gap: 1rem 1.25rem !important;
  width: 100% !important;
}

.dbt-col-12 { grid-column: span 12 / span 12 !important; }
.dbt-col-8  { grid-column: span 8 / span 8 !important; }
.dbt-col-6  { grid-column: span 6 / span 6 !important; }
.dbt-col-4  { grid-column: span 4 / span 4 !important; }

/* Dynamic reflow on responsive breakpoints */
@media (max-width: 768px) {
  .dbt-col-12,
  .dbt-col-8,
  .dbt-col-6,
  .dbt-col-4 {
    grid-column: span 12 / span 12 !important;
  }
}

/* Helper text & VIES intra-Community guidance */
.dbt-field-helper {
  font-size: 0.8rem;
  color: var(--dbt-text-muted);
  margin-top: 0.35rem;
  line-height: 1.4;
  display: block;
}

.dbt-vies-guidance {
  grid-column: span 12 / span 12 !important;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-left: 4px solid var(--dbt-primary);
  padding: 0.85rem 1.15rem;
  border-radius: var(--dbt-radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.865rem;
  color: #0369a1;
  line-height: 1.5;
  margin-top: 0.25rem;
}

.dbt-vies-guidance .dbt-icon {
  color: var(--dbt-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Billing data immutability notice banner */
.dbt-billing-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: var(--dbt-surface-alt);
  border: 1px solid var(--dbt-border-soft);
  border-left: 3px solid var(--dbt-primary);
  border-radius: var(--dbt-radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--dbt-text-muted);
}

.dbt-billing-notice .dbt-notice-icon {
  color: var(--dbt-primary);
  flex-shrink: 0;
  margin-top: 1px;
}

.dbt-billing-notice .dbt-notice-text {
  flex: 1;
}

/* Reset Understrap / WordPress form-row flex rules */
.wrapperregistro .dbt-registration-form-surface p.form-row {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  margin: 0 0 0.85rem 0 !important;
  width: 100% !important;
}

.wrapperregistro .dbt-registration-form-surface p.form-row[style*="display: none"],
.wrapperregistro .dbt-registration-form-surface p.form-row[style*="display:none"],
.wrapperregistro .dbt-registration-form-surface p.form-row.dbt-hidden,
.wrapperregistro .dbt-registration-form-surface .dbt-hidden,
.wrapperregistro .dbt-registration-form-surface [hidden] {
  display: none !important;
}

.wrapperregistro .dbt-registration-form-surface label:not(.radio):not(.checkbox):not(.cert) {
  width: 100% !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: var(--dbt-dark-900) !important;
  margin-bottom: 0.35rem !important;
  display: block !important;
  line-height: 1.35 !important;
}

.wrapperregistro .dbt-registration-form-surface label .required {
  color: #dc2626;
  font-weight: 700;
  text-decoration: none;
}

.wrapperregistro .dbt-registration-form-surface input.input-text,
.wrapperregistro .dbt-registration-form-surface select,
.wrapperregistro .dbt-registration-form-surface .select2-container--default .select2-selection--single {
  width: 100% !important;
  height: 44px !important;
  padding: 0.55rem 0.95rem !important;
  font-size: 0.925rem !important;
  border: 1px solid var(--dbt-border-soft) !important;
  border-radius: var(--dbt-radius-sm) !important;
  background-color: #ffffff !important;
  color: var(--dbt-dark-900) !important;
  transition: border-color var(--dbt-transition), box-shadow var(--dbt-transition) !important;
}

.wrapperregistro .dbt-registration-form-surface input.input-text:focus,
.wrapperregistro .dbt-registration-form-surface select:focus {
  border-color: var(--dbt-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.16) !important;
}

/* Invalid / Error field highlights */
.wrapperregistro .dbt-registration-form-surface .woocommerce-invalid input.input-text,
.wrapperregistro .dbt-registration-form-surface input.input-text.has-error {
  border-color: #dc2626 !important;
  background-color: #fffaf0 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}

/* Checkbox field styling (Terms, Recargo, Consent) */
.wrapperregistro .dbt-registration-form-surface p.form-row.woocommerce-form-row--checkbox,
.wrapperregistro .dbt-registration-form-surface p.form-row#recargo_field,
.wrapperregistro .dbt-registration-form-surface p.form-row#comercial_field,
.wrapperregistro .dbt-registration-form-surface p.form-row#consentimiento_field {
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 0.75rem !important;
  margin-bottom: 0.85rem !important;
}

.wrapperregistro .dbt-registration-form-surface label.checkbox {
  width: auto !important;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
  color: var(--dbt-text-muted) !important;
  cursor: pointer !important;
  line-height: 1.45 !important;
}

.wrapperregistro .dbt-registration-form-surface input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  margin-top: 2px !important;
  flex-shrink: 0 !important;
  accent-color: var(--dbt-primary) !important;
  cursor: pointer !important;
}

/* -------------------------------------------------------------
   Password Field with Eye Toggle
------------------------------------------------------------- */
.dbt-password-field-container {
  position: relative;
  display: block;
  width: 100%;
}

.dbt-password-field-container input {
  padding-right: 44px !important;
}

.dbt-password-toggle-btn {
  position: absolute;
  right: 8px;
  left: auto !important;
  top: 50%;
  transform: translateY(-50%);
  width: 32px !important;
  max-width: 32px !important;
  height: 32px !important;
  max-height: 32px !important;
  background: none;
  border: none;
  padding: 6px;
  color: var(--dbt-text-subtle);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--dbt-radius-sm);
  transition: color var(--dbt-transition);
  z-index: 2;
  box-sizing: border-box;
}

.dbt-password-toggle-btn svg {
  pointer-events: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.dbt-password-toggle-btn:hover {
  color: var(--dbt-dark-900);
}

.dbt-password-toggle-btn:focus,
.dbt-password-toggle-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--dbt-primary);
}

/* Guard against duplicate or conflicting WooCommerce password overlays */
.show-password-input {
  display: none !important;
}

/* -------------------------------------------------------------
   Distributor Certificate Styled Dropzone
------------------------------------------------------------- */
.dbt-distributor-upload-box {
  background: var(--dbt-surface-alt);
  border: 2px dashed #cbd5e1;
  border-radius: var(--dbt-radius-md);
  padding: 1.85rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--dbt-transition);
  margin: 0.5rem 0 1rem 0;
  position: relative;
}

.dbt-distributor-upload-box:hover,
.dbt-distributor-upload-box.is-dragover {
  border-color: var(--dbt-primary);
  background: #f0f7ff;
}

.dbt-distributor-upload-box.has-file {
  border-style: solid;
  border-color: #bae6fd;
  background: #f0f9ff;
  padding: 1.25rem;
}

/* Hide native file input residue */
.dbt-distributor-upload-box input[type="file"] {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.dbt-upload-icon {
  color: var(--dbt-primary);
  margin-bottom: 0.65rem;
}

.dbt-upload-instruction {
  font-size: 0.925rem;
  color: var(--dbt-dark-900);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.dbt-upload-specs {
  font-size: 0.785rem;
  color: var(--dbt-text-muted);
}

.dbt-file-chosen-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: var(--dbt-surface);
  border: 1px solid #bae6fd;
  padding: 0.75rem 1.25rem;
  border-radius: var(--dbt-radius-sm);
  color: #0369a1;
}

.dbt-file-icon {
  color: var(--dbt-primary);
  flex-shrink: 0;
}

.dbt-file-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dbt-file-name {
  font-size: 0.875rem;
  font-weight: 650;
  word-break: break-all;
}

.dbt-file-remove-btn {
  background: none;
  border: none;
  color: var(--dbt-primary);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.825rem;
  padding: 0;
  transition: color var(--dbt-transition);
}

.dbt-file-remove-btn:hover {
  color: var(--dbt-primary-hover);
}

/* -------------------------------------------------------------
   Prominent Submit Action (Aligned with Digalco Primary CTA)
------------------------------------------------------------- */
.dbt-submit-wrapper {
  margin-top: 2rem;
  text-align: center;
}

.wrapperregistro .woocommerce-form-register__submit.dbt-submit-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.65rem !important;
  min-width: 290px !important;
  max-width: 440px !important;
  min-height: 52px !important;
  padding: 0.95rem 2.5rem !important;
  font-size: 1.05rem !important;
  font-weight: 650 !important;
  color: #ffffff !important;
  background: var(--dbt-primary) !important;
  border: 1px solid transparent !important;
  border-radius: var(--dbt-radius-pill) !important;
  cursor: pointer !important;
  box-shadow: var(--dbt-shadow-btn) !important;
  transition: all var(--dbt-transition) !important;
  line-height: 1.3 !important;
}

.wrapperregistro .woocommerce-form-register__submit.dbt-submit-btn:hover {
  background: var(--dbt-primary-hover) !important;
  box-shadow: var(--dbt-shadow-btn-hover) !important;
  transform: translateY(-2px) !important;
  color: #ffffff !important;
}

.wrapperregistro .woocommerce-form-register__submit.dbt-submit-btn:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3) !important;
}

.dbt-btn-icon {
  flex-shrink: 0;
  transition: transform var(--dbt-transition);
}

.wrapperregistro .woocommerce-form-register__submit.dbt-submit-btn:hover .dbt-btn-icon {
  transform: translateX(3px);
}

/* -------------------------------------------------------------
   Responsive Breakpoints (Desktop 1440px vs Mobile 390px)
------------------------------------------------------------- */
@media (max-width: 767px) {
  .dbt-registration-wrapper {
    margin: 1rem auto 2.5rem;
    padding: 0 0.5rem;
  }

  .dbt-reg-title {
    font-size: 1.55rem;
  }

  .dbt-reg-subtitle {
    font-size: 0.95rem;
  }

  .dbt-registration-form-surface {
    padding: 1.5rem 1.25rem;
    border-radius: var(--dbt-radius-md);
  }

  .dbt-reg-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
  }

  .dbt-type-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .dbt-fields-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .dbt-registration-switch-callout {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
  }

  .dbt-switch-action {
    width: 100%;
    justify-content: flex-start;
  }

  .wrapperregistro .woocommerce-form-register__submit.dbt-submit-btn {
    width: 100% !important;
    max-width: 100% !important;
  }
}
