/**
 * Mercado Mayor — "Incorporacion de Proveedores" (slug: vendor-onboarding)
 * ---------------------------------------------------------------------------
 * Styles page-vendor-onboarding.php and the markup Dokan's
 * [dokan-vendor-onboarding-registration] shortcode prints inside it:
 *
 *   .dokan-vendor-onboarding > .dokan-onboarding-container
 *       .dokan-login-section        h2 + WooCommerce form-login
 *       .dokan-registration-section h2 + form.dokan-vendor-register
 *
 * Loaded after page-hero.css (whose .mm-hero / .mm-section-head components are
 * reused) and after b2b-marketplace.css — whose §5/§6 rules already give the
 * inputs and submit buttons the site treatment, since this page is not
 * `.woocommerce-account` and so is not excluded by their `:not()` guard. What is
 * left here is layout, the two panels, and the video hero's proportions.
 */

/* ========================================================================
   1. HERO
   ======================================================================== */
.mm-hero--onboarding{
  min-height: clamp(300px, 34vw, 460px);
}

/* ========================================================================
   2. LEFTOVER EDITOR BLOCK
   ========================================================================
 * The page content opens with a preformatted block reading "Incorporación de
 * proveedores" — the same words as the page title, in monospace. It reads as a
 * mistake rather than a heading. Hidden rather than deleted from the database,
 * so the block is still there if it turns out to be wanted; removing it in the
 * editor would let this rule go.
 */
body.mm-page-vendor-onboarding .entry-content > .wp-block-preformatted{
  display: none;
}

/* The shortcode is wrapped in a <p> by the editor, which adds a stray margin
   above the panels. */
body.mm-page-vendor-onboarding .entry-content > p:empty{
  display: none;
}

/* ========================================================================
   3. TWO-PANEL ONBOARDING
   ======================================================================== */
body.mm-page-vendor-onboarding .dokan-onboarding-container{
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(14px, 1.8vw, 26px);
  align-items: start;
  max-width: 1040px;
  margin: 0 auto;
}

/* Dokan adds this class when only one of the two panels is shown. */
body.mm-page-vendor-onboarding .dokan-onboarding-single{
  grid-template-columns: minmax(0, 1fr);
  max-width: 620px;
}

body.mm-page-vendor-onboarding .dokan-login-section,
body.mm-page-vendor-onboarding .dokan-registration-section{
  position: relative;
  padding: clamp(18px, 2.4vw, 32px);
  background: var(--mm-surface);
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius-lg);
  box-shadow: var(--mm-shadow-sm);
  overflow: hidden;
}

/* Registration is the action this page exists for, so it is the one that gets
   the accent edge and the deeper shadow. */
body.mm-page-vendor-onboarding .dokan-registration-section{
  box-shadow: var(--mm-shadow-md);
}

body.mm-page-vendor-onboarding .dokan-registration-section::before{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--mm-accent), #F87171);
}

/* Panel headings. `text-transform` is declared because style.css carries
   `section h2 { text-transform: uppercase; text-align: center }` and these sit
   inside the page's <section> wrappers. */
body.mm-page-vendor-onboarding .dokan-login-section > h2,
body.mm-page-vendor-onboarding .dokan-registration-section > h2{
  margin: 0 0 16px;
  padding: 0 0 12px;
  font-family: var(--mm-font-display) !important;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  font-weight: 600 !important;
  line-height: 1.3;
  letter-spacing: -.01em;
  text-transform: none;
  text-align: left;
  color: var(--mm-ink);
  border-bottom: 1px solid var(--mm-border);
}

/* ========================================================================
   4. FORM FIELDS
   ========================================================================
 * Both forms use WooCommerce's `p.form-row` rows. Dokan floats some of them
 * (form-row-first / form-row-last / .split-row) which collapses awkwardly
 * inside a narrow panel — grid replaces the floats.
 */
body.mm-page-vendor-onboarding .dokan-vendor-onboarding form{
  margin: 0;
}

/* style.css pins the WooCommerce login form to a hard `width: 450px`. Inside
   this panel the content box is ~359px, so the form and every row in it hung
   90px past the card's right edge. The selector matches the theme's own
   three-class one and adds the body class to win. */
body.mm-page-vendor-onboarding form.woocommerce-form-login.login{
  width: 100% !important;
  max-width: none !important;
  margin: 0;
  padding: 0;
  border: 0;
}

body.mm-page-vendor-onboarding .dokan-vendor-onboarding .form-row{
  display: block;
  float: none !important;
  width: auto !important;
  margin: 0 0 14px;
  padding: 0;
}

/* First name + last name share a row on anything but a phone. */
body.mm-page-vendor-onboarding .split-row.name-field{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

body.mm-page-vendor-onboarding .dokan-vendor-onboarding label{
  display: block;
  margin: 0 0 5px;
  font-family: var(--mm-font-ui) !important;
  font-size: var(--mm-text-sm);
  font-weight: 500;
  line-height: 1.4;
  color: var(--mm-ink);
}

body.mm-page-vendor-onboarding .dokan-vendor-onboarding .required{
  color: var(--mm-accent);
  text-decoration: none;
  border: 0;
}

/* Width is the only thing missing — §6 of b2b-marketplace.css already supplies
   the border, radius, padding and focus ring for these input types. */
body.mm-page-vendor-onboarding .dokan-vendor-onboarding input[type="text"],
body.mm-page-vendor-onboarding .dokan-vendor-onboarding input[type="email"],
body.mm-page-vendor-onboarding .dokan-vendor-onboarding input[type="tel"],
body.mm-page-vendor-onboarding .dokan-vendor-onboarding input[type="password"],
body.mm-page-vendor-onboarding .dokan-vendor-onboarding select{
  width: 100%;
  box-sizing: border-box;
}

/* The shop-URL row prints a live preview of the storefront address. */
body.mm-page-vendor-onboarding .dokan-vendor-onboarding .form-row .dokan-shop-url{
  display: block;
  margin-top: 6px;
  font-family: var(--mm-font-ui) !important;
  font-size: var(--mm-text-xs);
  line-height: 1.5;
  color: var(--mm-ink-muted);
  word-break: break-all;
}

/* "Remember me" is a checkbox, not a field label — it must not inherit the
   block display above or the box lands on its own line. */
body.mm-page-vendor-onboarding .woocommerce-form-login__rememberme{
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  font-weight: 400 !important;
  color: var(--mm-ink-muted) !important;
}

body.mm-page-vendor-onboarding .woocommerce-form-login__rememberme input{
  width: auto;
  margin: 0;
}

/* Buttons stretch: each panel has exactly one action. */
body.mm-page-vendor-onboarding .dokan-vendor-onboarding button[type="submit"],
body.mm-page-vendor-onboarding .dokan-vendor-onboarding input[type="submit"]{
  width: 100%;
  margin-top: 2px;
}

body.mm-page-vendor-onboarding .lost_password{
  margin: 12px 0 0;
  font-family: var(--mm-font-ui) !important;
  font-size: var(--mm-text-sm);
}

body.mm-page-vendor-onboarding .lost_password a{
  color: var(--mm-ink-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.mm-page-vendor-onboarding .lost_password a:hover{
  color: var(--mm-accent);
}

/* No rule for Dokan's "Antispam" honeypot field: the plugin already parks it at
   left: -13365px, and hiding it with `display: none` here would only risk
   interfering with a bot trap that is working. */

/* ========================================================================
   5. SIGNED-IN PANEL
   ======================================================================== */
.mm-onboarding-signedin{
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(24px, 3vw, 40px);
  text-align: center;
  background: var(--mm-surface);
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-radius-lg);
  box-shadow: var(--mm-shadow-sm);
}

.mm-onboarding-signedin__mark{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: var(--mm-radius-pill);
  background: var(--mm-accent-soft);
  color: var(--mm-accent);
}

.mm-onboarding-signedin__mark svg{
  width: 20px;
  height: 20px;
}

.mm-onboarding-signedin__title{
  margin: 0 0 8px;
  font-family: var(--mm-font-display) !important;
  font-size: clamp(1.125rem, 1.8vw, 1.4375rem);
  font-weight: 600 !important;
  line-height: 1.25;
  letter-spacing: -.015em;
  text-transform: none;
  color: var(--mm-ink);
}

.mm-onboarding-signedin__text{
  margin: 0 0 20px;
  font-family: var(--mm-font-ui) !important;
  font-size: var(--mm-text-base);
  line-height: 1.65;
  color: var(--mm-ink-muted);
}

.mm-onboarding-signedin__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* ========================================================================
   6. RESPONSIVE
   ======================================================================== */

/* Below this the login panel is too narrow to hold its labels on one line, so
   the two panels stack — registration first, since that is why most visitors
   are on this page. */
@media (max-width: 860px){
  body.mm-page-vendor-onboarding .dokan-onboarding-container{
    grid-template-columns: minmax(0, 1fr);
    max-width: 620px;
  }
  body.mm-page-vendor-onboarding .dokan-registration-section{
    order: -1;
  }
}

@media (max-width: 599px){
  body.mm-page-vendor-onboarding .split-row.name-field{
    grid-template-columns: minmax(0, 1fr);
  }
  .mm-onboarding-signedin__actions{
    flex-direction: column;
    align-items: stretch;
  }
  .mm-onboarding-signedin__actions .mm-btn{
    width: 100%;
  }
}
