/**
 * Woo B2B — front-end auth page styles.
 * Theme-neutral; scoped under .wb2b-auth.
 */

.wb2b-auth {
    --wb2b-primary: #2b6cb0;
    --wb2b-primary-hover: #245a96;
    --wb2b-border: #d9dee5;
    --wb2b-bg: #fff;
    --wb2b-muted: #6b7280;
    --wb2b-error: #b42318;
    --wb2b-error-bg: #fdecea;
    --wb2b-success: #1c7c4a;
    --wb2b-success-bg: #e7f5ee;
    --wb2b-radius: 14px;
    --wb2b-radius-sm: 10px;
    --wb2b-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
    --wb2b-shadow-lg: 0 18px 40px -12px rgba(16, 24, 40, 0.22);
    /* Fill the theme's content container (no breakout). */
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.wb2b-auth *,
.wb2b-auth *::before,
.wb2b-auth *::after {
    box-sizing: border-box;
}

/* Layout */
.wb2b-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 860px) {
    .wb2b-grid {
        grid-template-columns: 1fr;
    }
}

.wb2b-card {
    background: var(--wb2b-bg);
    border: 1px solid var(--wb2b-border);
    border-radius: var(--wb2b-radius);
    padding: 28px;
    box-shadow: var(--wb2b-shadow);
}

.wb2b-card__title {
    margin: 0 0 6px;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.wb2b-card__intro {
    margin: 0 0 18px;
    color: var(--wb2b-muted);
}

/* Notices */
.wb2b-notice {
    border-radius: 8px;
    padding: 14px 18px;
    margin: 0 0 20px;
    border: 1px solid transparent;
}

.wb2b-notice ul {
    margin: 0;
    padding-left: 18px;
}

.wb2b-notice--error {
    background: var(--wb2b-error-bg);
    border-color: var(--wb2b-error);
    color: var(--wb2b-error);
}

.wb2b-notice--success {
    background: var(--wb2b-success-bg);
    border-color: var(--wb2b-success);
    color: var(--wb2b-success);
}

/* Fields */
.wb2b-fieldset {
    border: 0;
    border-top: 1px solid var(--wb2b-border);
    margin: 18px 0 0;
    padding: 18px 0 0;
}

.wb2b-fieldset:first-of-type {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.wb2b-fieldset legend {
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0 0 0 12px;
    margin-bottom: 14px;
    border-left: 3px solid var(--wb2b-primary);
    line-height: 1.2;
}

.wb2b-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0;
}

.wb2b-field {
    margin: 0 0 14px;
    flex: 1 1 100%;
    min-width: 0;
}

.wb2b-field label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.wb2b-col-3 { flex: 1 1 calc(25% - 14px); }
.wb2b-col-4 { flex: 1 1 calc(33.333% - 14px); }
.wb2b-col-6 { flex: 1 1 calc(50% - 14px); }
.wb2b-col-8 { flex: 1 1 calc(66.666% - 14px); }
.wb2b-col-12 { flex: 1 1 100%; }

@media (max-width: 560px) {
    .wb2b-col-3,
    .wb2b-col-4,
    .wb2b-col-6,
    .wb2b-col-8 {
        flex: 1 1 100%;
    }
}

.wb2b-input,
.wb2b-field input[type="text"],
.wb2b-field input[type="email"],
.wb2b-field input[type="password"],
.wb2b-field input[type="file"],
.wb2b-field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--wb2b-border);
    border-radius: var(--wb2b-radius-sm);
    font-size: 0.95rem;
    background: #fff;
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wb2b-input:focus,
.wb2b-field input:focus,
.wb2b-field select:focus {
    outline: none;
    border-color: var(--wb2b-primary);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

.wb2b-help {
    display: block;
    color: var(--wb2b-muted);
    font-size: 0.82rem;
    margin-top: 4px;
}

.wb2b-field--inline {
    display: flex;
    align-items: center;
}

.wb2b-checkbox {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
}

.wb2b-checkbox input {
    margin-top: 3px;
}

.wb2b-privacy {
    margin: 18px 0;
    padding: 14px;
    border: 1px solid var(--wb2b-border);
    border-radius: 8px;
    background: #f9fafb;
}

.wb2b-required-note {
    color: var(--wb2b-muted);
    font-size: 0.85rem;
}

/* Buttons */
.wb2b-btn {
    display: inline-block;
    background: var(--wb2b-primary);
    color: #fff;
    border: 0;
    border-radius: var(--wb2b-radius-sm);
    padding: 13px 26px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px -6px var(--wb2b-primary);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.wb2b-btn:hover {
    background: var(--wb2b-primary-hover);
    color: #fff;
    transform: translateY(-1px);
    filter: brightness(1.02);
}

.wb2b-btn--lg {
    padding: 15px 32px;
    font-size: 1.05rem;
}

.wb2b-btn--block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Win over the active theme's generic button reset (e.g. WoodMart styles every
   [type=submit] with a near-white --btn-bgcolor at the same specificity as .wb2b-btn,
   so its later rule would otherwise hide our button). 0,2,0 beats [type=submit] 0,1,0. */
.wb2b-auth .wb2b-btn {
    background-color: var(--wb2b-primary);
    color: #fff;
    box-shadow: 0 6px 16px -6px var(--wb2b-primary);
}

.wb2b-auth .wb2b-btn:hover,
.wb2b-auth .wb2b-btn:focus {
    background-color: var(--wb2b-primary-hover);
    color: #fff;
}

.wb2b-submit {
    margin: 18px 0 0;
}

.wb2b-card--register .wb2b-submit {
    text-align: right;
}

/* Login extras */
.wb2b-login-recover {
    margin: 4px 0 12px;
    font-size: 0.88rem;
}

.wb2b-advantages {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--wb2b-border);
}

.wb2b-advantages__title {
    font-size: 1rem;
    margin: 0 0 8px;
}

.wb2b-advantages ul {
    margin: 0;
    padding-left: 18px;
    color: var(--wb2b-muted);
}

/* Honeypot — visually hidden but reachable by bots. */
.wb2b-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.wb2b-auth--note {
    border: 1px solid var(--wb2b-border);
    border-radius: 10px;
    padding: 18px 22px;
    max-width: 640px;
    margin: 0 auto;
}

/* ============================================================
   Skin: inherit active-theme styles. Remaps the plugin's auth
   variables to WoodMart's design tokens, each with the plugin's
   own value as a fallback — so on a theme that doesn't define
   these tokens the page simply renders the default look.
   Applied via the "Inherit theme styles" setting.
   ============================================================ */
.wb2b-auth.wb2b-skin--theme {
    --wb2b-primary: var(--wd-primary-color, var(--btn-accented-bgcolor, #2b6cb0));
    --wb2b-primary-hover: var(--btn-accented-bgcolor-hover, var(--wd-primary-color, #245a96));
    --wb2b-bg: var(--bgcolor-white, #fff);          /* surface — flips in dark mode */
    --wb2b-border: var(--wd-form-brd-color, #d9dee5);
    --wb2b-muted: var(--wd-text-color, #6b7280);
    color: var(--wd-text-color, inherit);           /* body text follows the scheme */
}

/* Headings + labels follow the theme's title colour (also flips in dark mode). */
.wb2b-auth.wb2b-skin--theme .wb2b-card__title,
.wb2b-auth.wb2b-skin--theme .wb2b-fieldset legend,
.wb2b-auth.wb2b-skin--theme .wb2b-field label {
    color: var(--wd-title-color, inherit);
}

.wb2b-auth.wb2b-skin--theme .wb2b-input,
.wb2b-auth.wb2b-skin--theme .wb2b-field input[type="text"],
.wb2b-auth.wb2b-skin--theme .wb2b-field input[type="email"],
.wb2b-auth.wb2b-skin--theme .wb2b-field input[type="password"],
.wb2b-auth.wb2b-skin--theme .wb2b-field input[type="file"],
.wb2b-auth.wb2b-skin--theme .wb2b-field select,
.wb2b-auth.wb2b-skin--theme .wb2b-field textarea {
    background: var(--wd-form-bg, #fff);            /* form fields follow the scheme */
    color: var(--wd-form-color, inherit);
    border-radius: var(--wd-form-brd-radius, var(--wd-brd-radius, 7px));
    min-height: var(--wd-form-height, 42px);
}

.wb2b-auth.wb2b-skin--theme .wb2b-input::placeholder,
.wb2b-auth.wb2b-skin--theme .wb2b-field input::placeholder {
    color: var(--wd-form-placeholder, #94a3b8);
}

.wb2b-auth.wb2b-skin--theme .wb2b-input:focus,
.wb2b-auth.wb2b-skin--theme .wb2b-field input:focus,
.wb2b-auth.wb2b-skin--theme .wb2b-field select:focus {
    border-color: var(--wb2b-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.wb2b-auth.wb2b-skin--theme .wb2b-btn {
    color: var(--btn-accented-color, #fff);
    border-radius: var(--btn-accented-brd-radius, var(--wd-brd-radius, 7px));
}

.wb2b-auth.wb2b-skin--theme .wb2b-btn:hover {
    color: var(--btn-accented-color-hover, var(--btn-accented-color, #fff));
}

.wb2b-auth.wb2b-skin--theme .wb2b-card {
    border-radius: var(--wd-brd-radius, 10px);
}

/* Subtle panel that works on light or dark surfaces. */
.wb2b-auth.wb2b-skin--theme .wb2b-privacy {
    background: color-mix(in srgb, var(--wd-text-color, #0f172a) 5%, var(--bgcolor-white, #fff));
}

/* ============================================================
   Hero / benefits band (modern auth layout)
   ============================================================ */
.wb2b-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--wb2b-radius);
    padding: 34px 38px;
    margin-bottom: 28px;
    color: #fff;
    background-image:
        linear-gradient(135deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.30)),
        linear-gradient(135deg, var(--wb2b-primary), var(--wb2b-primary-hover));
    box-shadow: var(--wb2b-shadow-lg);
    display: flex;
    flex-wrap: wrap;
    gap: 24px 48px;
    align-items: center;
    justify-content: space-between;
}

.wb2b-hero__text { flex: 1 1 360px; }

.wb2b-hero__eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.85;
    margin-bottom: 8px;
}

.wb2b-hero__title {
    margin: 0 0 10px;
    font-size: 1.8rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.wb2b-hero__subtitle {
    margin: 0;
    font-size: 1rem;
    line-height: 1.55;
    opacity: 0.92;
    max-width: 52ch;
}

.wb2b-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
    flex: 0 1 300px;
}

.wb2b-benefit {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
}

.wb2b-benefit__check {
    position: relative;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.wb2b-benefit__check::after {
    content: "";
    position: absolute;
    left: 8px;
    top: 4px;
    width: 4px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

@media (max-width: 600px) {
    .wb2b-hero { padding: 26px 24px; }
    .wb2b-hero__title { font-size: 1.5rem; }
}

/* Theme skin: match the theme's corner radius on the hero too. */
.wb2b-auth.wb2b-skin--theme .wb2b-hero { border-radius: var(--wd-brd-radius, 14px); }
