/* ========================================
   SOUVE AUTH FLOW — FINAL FIXED
======================================== */

/* PC / TAB */
@media (min-width: 769px) {
    .souve-auth-flow {
        --souve-auth-text: #111;
        --souve-auth-border: #d9d9d9;
        --souve-auth-border-focus: #111;
        --souve-auth-surface: #f7f7f7;
        --souve-auth-label-bg: #fff;

        width: 100%;
        min-width: 350px;
        margin: 0 auto;
        color: var(--souve-auth-text);
        display: block;
        padding: 0 35px;
    }

    .souve-auth-flow [data-auth-step] {
        width: 100%;
        display: block;
    }

    .souve-auth-flow .souve-auth-notices,
    .souve-auth-flow .woocommerce-form-row,
    .souve-auth-flow .form-row,
    .souve-auth-flow .souve-auth-submit-wrap,
    .souve-auth-flow .souve-auth-links,
    .souve-auth-flow .souve-auth-socials {
        width: 100%;
        box-sizing: border-box;
    }

    .souve-auth-flow .souve-auth-title {
        font-size: 18px;
        font-weight: 600;
        text-align: center;
        margin: 0px -35px 20px -35px;
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-bottom: 1px solid var(--e-global-color-402fd8e);
    }

    .souve-auth-flow .souve-auth-desc {
        font-size: 12px;
		margin: 0px 0px 10px 0px;
    }

    .souve-auth-flow .form-row,
    .souve-auth-flow .woocommerce-form-row {
        margin-bottom: 16px;
    }

    .souve-auth-flow input[type="email"],
    .souve-auth-flow input[type="password"],
    .souve-auth-flow input[type="text"] {
        width: 100%;
        border: 1px solid var(--souve-auth-border);
        border-radius: 4px;
        background: #fff;
        padding: 14px 16px;
        font-size: 14px;
        line-height: 1.2;
        color: var(--souve-auth-text);
        box-shadow: none;
        box-sizing: border-box;
    }

    .souve-auth-flow input[type="email"]:focus,
    .souve-auth-flow input[type="password"]:focus,
    .souve-auth-flow input[type="text"]:focus {
        border-color: var(--souve-auth-border-focus);
        outline: none;
    }

    .souve-auth-flow input::placeholder {
        color: #9d9d9d;
    }

    /* ========================================
       PASSWORD FIELD
    ======================================== */

    .souve-auth-flow .souve-auth-password-wrap {
        position: relative;
        display: block;
        width: 100%;
    }

    .souve-auth-flow .souve-auth-password-wrap input {
        width: 100%;
        padding-right: 52px;
    }

    .souve-auth-flow .souve-auth-password-toggle {
        position: absolute;
        top: 50%;
        right: 14px;
        transform: translateY(-50%);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #555;
        cursor: pointer;
        z-index: 3;
    }

    .souve-auth-flow .souve-auth-password-toggle:hover {
        color: #111;
    }

    .souve-auth-flow .souve-auth-password-toggle svg {
        display: block;
        width: 20px;
        height: 20px;
        stroke: currentColor;
        fill: none;
        pointer-events: none;
    }

    .souve-auth-flow .souve-auth-help {
        margin: 0px 0px 0px 5px;
        font-size: 12px;
    }

    /* ========================================
       EMAIL DISPLAY
    ======================================== */

    .souve-auth-flow .souve-auth-email-display {
        margin-bottom: 18px;
    }

    .souve-auth-flow .souve-auth-email-value {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        max-height: 42px;
        border: 1px solid var(--souve-auth-border);
        border-radius: 4px;
        padding: 5px 10px 5px 20px;
        background: var(--souve-auth-surface);
        box-sizing: border-box;
    }

    .souve-auth-flow .souve-auth-email-text {
        display: block;
        font-size: 13px;
        line-height: 13px;
        word-break: break-word;
    }

    .souve-auth-flow .souve-auth-edit {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        padding: 0;
        border: 0;
        border-radius: 999px;
        background: transparent;
        cursor: pointer;
        transition: background-color .2s ease;
    }

    .souve-auth-flow .souve-auth-edit img {
        display: block;
        width: 18px;
        height: 18px;
        max-width: 18px;
    }

    /* ========================================
       BUTTONS
    ======================================== */

    .souve-auth-flow .souve-auth-submit-wrap {
        margin-top: 20px;
        margin-bottom: 8px;
    }

    .souve-auth-flow .souve-auth-submit,
    .souve-auth-flow .souve-auth-links button,
    .souve-auth-flow .woocommerce-Button.button {
        font-size: 13px;
        text-transform: none !important;
        letter-spacing: 0 !important;
    }

    .souve-auth-flow .souve-auth-submit {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 10px 20px;
        border-radius: 4px;
        background: #111;
        color: #fff;
        font-weight: 600;
        line-height: 1;
        text-align: center;
        box-sizing: border-box;
        transition: transform .05s ease, opacity .2s ease, background-color .2s ease, border-color .2s ease;
    }

    .souve-auth-flow .souve-auth-submit:hover {
        background: #222;
        border-color: #222;
        color: #fff;
    }

    .souve-auth-flow .souve-auth-submit:active {
        transform: translateY(1px);
    }

    .souve-auth-flow .souve-auth-submit.is-loading {
        opacity: .75;
        pointer-events: none;
    }

    .souve-auth-flow .souve-btn-spinner {
        display: none;
        width: 16px;
        height: 16px;
        margin-left: 10px;
        border: 2px solid rgba(255,255,255,.35);
        border-top-color: #fff;
        border-radius: 50%;
        animation: souveAuthSpin .75s linear infinite;
    }

    .souve-auth-flow .souve-auth-submit.is-loading .souve-btn-spinner {
        display: inline-block;
    }

    @keyframes souveAuthSpin {
        to { transform: rotate(360deg); }
    }

    .souve-auth-flow .souve-auth-links {
        margin-top: 14px;
        text-align: center;
    }

    .souve-auth-flow .souve-auth-links button {
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--e-global-color-primary);
        font-size: 13px !important;
        font-weight: 600;
        text-decoration: none;
        cursor: pointer;
        min-height: auto;
        width: auto;
    }

    .souve-auth-flow .souve-auth-links button:hover {
        color: #000;
    }

    /* ========================================
       TEXT BLOCKS
    ======================================== */

    .souve-auth-flow .woocommerce-privacy-policy-text {
        font-size: 12px;
        line-height: 1.6;
    }

    .souve-auth-flow .woocommerce-privacy-policy-text a {
        color: inherit;
        text-decoration: underline;
    }

    .souve-auth-flow .woocommerce-error,
    .souve-auth-flow .woocommerce-message {
        margin: 0 0 14px;
        border-radius: 4px;
        font-size: 14px;
        padding: 12px 14px;
    }

    /* ========================================
       FLOATING LABELS
    ======================================== */

    .souve-auth-flow .woocommerce-form-row {
        position: relative;
        padding-top: 8px;
    }

    .souve-auth-flow .woocommerce-form-row > label {
        position: absolute;
        top: 8px;
        left: 12px;
        transform: translateY(-50%) scale(0.85);
        transform-origin: left center;
        background: var(--souve-auth-label-bg);
        padding: 0 6px;
        margin: 0;
        z-index: 2;
        font-size: 14px;
        font-weight: 600;
        line-height: 1;
        pointer-events: none;
    }

    .souve-auth-flow .souve-auth-password-wrap + .souve-auth-help {
        position: relative;
        z-index: 1;
    }

    .souve-auth-flow .woocommerce-privacy-policy-text,
    .souve-auth-flow .souve-auth-links,
    .souve-auth-flow .souve-auth-submit-wrap,
    .souve-auth-flow .souve-auth-desc {
        position: static;
    }
}

/* MOBILE */
@media (max-width: 768px) {
    .souve-auth-flow {
        --souve-auth-text: #111;
        --souve-auth-border: #d9d9d9;
        --souve-auth-border-focus: #111;
        --souve-auth-surface: #f7f7f7;
        --souve-auth-label-bg: #fff;

        width: 100%;
        min-width: 100%;
        max-width: 100%;
        margin: 0 auto;
        color: var(--souve-auth-text);
        display: block;
    }

    .souve-auth-flow [data-auth-step] {
        width: 100%;
        display: block;
        padding: 0 20px;
    }

    .souve-auth-flow .souve-auth-notices,
    .souve-auth-flow .woocommerce-form-row,
    .souve-auth-flow .form-row,
    .souve-auth-flow .souve-auth-submit-wrap,
    .souve-auth-flow .souve-auth-links,
    .souve-auth-flow .souve-auth-socials {
        width: 100%;
        box-sizing: border-box;
    }

    .souve-auth-flow .souve-auth-title {
    margin: 0px -20px 15px -20px;
    font-size: 18px;
    font-weight: 600;
    min-height: 50px;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--e-global-color-402fd8e);
    align-items: center;
}

    .souve-auth-flow .souve-auth-desc {
        font-size: 14px;
		margin: 0px 0px 10px 0px;
    }

    .souve-auth-flow .form-row,
    .souve-auth-flow .woocommerce-form-row {
        margin-bottom: 16px;
    }

    .souve-auth-flow input[type="email"],
    .souve-auth-flow input[type="password"],
    .souve-auth-flow input[type="text"] {
        width: 100%;
        border: 1px solid var(--souve-auth-border);
        border-radius: 4px;
        background: #fff;
        padding: 14px 16px;
        font-size: 13px;
        line-height: 1.2;
        color: var(--souve-auth-text);
        box-shadow: none;
        box-sizing: border-box;
    }

    .souve-auth-flow input[type="email"]:focus,
    .souve-auth-flow input[type="password"]:focus,
    .souve-auth-flow input[type="text"]:focus {
        border-color: var(--souve-auth-border-focus);
        outline: none;
    }

    .souve-auth-flow input::placeholder {
        color: #9d9d9d;
    }

    /* ========================================
       PASSWORD FIELD
    ======================================== */

    .souve-auth-flow .souve-auth-password-wrap {
        position: relative;
        display: block;
        width: 100%;
    }

    .souve-auth-flow .souve-auth-password-wrap input {
        width: 100%;
        padding-right: 52px;
    }

    .souve-auth-flow .souve-auth-password-toggle {
        position: absolute;
        top: 50%;
        right: 14px;
        transform: translateY(-50%);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #555;
        cursor: pointer;
        z-index: 3;
    }

    .souve-auth-flow .souve-auth-password-toggle:hover {
        color: #111;
    }

    .souve-auth-flow .souve-auth-password-toggle svg {
        display: block;
        width: 20px;
        height: 20px;
        stroke: currentColor;
        fill: none;
        pointer-events: none;
    }

    .souve-auth-flow .souve-auth-help {
        margin: 0px 0px 0px 5px;
        font-size: 14px;
    }

    /* ========================================
       EMAIL DISPLAY
    ======================================== */

    .souve-auth-flow .souve-auth-email-display {
        margin-bottom: 18px;
    }

    .souve-auth-flow .souve-auth-email-value {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        max-height: 42px;
        border: 1px solid var(--souve-auth-border);
        border-radius: 4px;
        padding: 5px 10px 5px 20px;
        background: var(--souve-auth-surface);
        box-sizing: border-box;
    }

    .souve-auth-flow .souve-auth-email-text {
        display: block;
        font-size: 13px;
        line-height: 13px;
        word-break: break-word;
    }

    .souve-auth-flow .souve-auth-edit {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        padding: 0;
        border: 0;
        border-radius: 999px;
        background: transparent;
        cursor: pointer;
        transition: background-color .2s ease;
    }

    .souve-auth-flow .souve-auth-edit img {
        display: block;
        width: 18px;
        height: 18px;
        max-width: 18px;
    }

    /* ========================================
       BUTTONS
    ======================================== */

    .souve-auth-flow .souve-auth-submit-wrap {
        margin-top: 15px;
        margin-bottom: 8px;
    }

    .souve-auth-flow .souve-auth-submit,
    .souve-auth-flow .souve-auth-links button,
    .souve-auth-flow .woocommerce-Button.button {
        font-size: 14px;
        text-transform: none !important;
        letter-spacing: 0 !important;
    }

    .souve-auth-flow .souve-auth-submit {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 10px 20px;
        border-radius: 4px;
        background: #111;
        color: #fff;
        font-weight: 600;
        line-height: 1;
        text-align: center;
        box-sizing: border-box;
        transition: transform .05s ease, opacity .2s ease, background-color .2s ease, border-color .2s ease;
    }

    .souve-auth-flow .souve-auth-submit:hover {
        background: #222;
        border-color: #222;
        color: #fff;
    }

    .souve-auth-flow .souve-auth-submit:active {
        transform: translateY(1px);
    }

    .souve-auth-flow .souve-auth-submit.is-loading {
        opacity: .75;
        pointer-events: none;
    }

    .souve-auth-flow .souve-btn-spinner {
        display: none;
        width: 16px;
        height: 16px;
        margin-left: 10px;
        border: 2px solid rgba(255,255,255,.35);
        border-top-color: #fff;
        border-radius: 50%;
        animation: souveAuthSpin .75s linear infinite;
    }

    .souve-auth-flow .souve-auth-submit.is-loading .souve-btn-spinner {
        display: inline-block;
    }

    @keyframes souveAuthSpin {
        to { transform: rotate(360deg); }
    }

    .souve-auth-flow .souve-auth-links {
        margin-top: 14px;
        text-align: center;
    }

    .souve-auth-flow .souve-auth-links button {
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--e-global-color-primary);
        font-size: 14px !important;
        font-weight: 600;
        text-decoration: none;
        cursor: pointer;
        min-height: auto;
        width: auto;
    }

    .souve-auth-flow .souve-auth-links button:hover {
        color: #000;
    }

    /* ========================================
       TEXT BLOCKS
    ======================================== */

    .souve-auth-flow .woocommerce-privacy-policy-text {
        font-size: 12px;
        /*line-height: 2;*/
    }

    .souve-auth-flow .woocommerce-privacy-policy-text a {
        color: inherit;
        text-decoration: underline;
    }

    .souve-auth-flow .woocommerce-error,
    .souve-auth-flow .woocommerce-message {
        margin: 0 0 14px;
        border-radius: 4px;
        font-size: 14px;
        padding: 12px 14px;
    }

    /* ========================================
       FLOATING LABELS
    ======================================== */

    .souve-auth-flow .woocommerce-form-row {
        position: relative;
        padding-top: 8px;
    }

    .souve-auth-flow .woocommerce-form-row > label {
        position: absolute;
        top: 8px;
        left: 12px;
        transform: translateY(-50%) scale(0.85);
        transform-origin: left center;
        background: var(--souve-auth-label-bg);
        padding: 0 6px;
        margin: 0;
        z-index: 2;
        font-size: 15px;
        font-weight: 600;
        line-height: 1;
        pointer-events: none;
    }

    .souve-auth-flow .souve-auth-password-wrap + .souve-auth-help {
        position: relative;
        z-index: 1;
    }

    .souve-auth-flow .woocommerce-privacy-policy-text,
    .souve-auth-flow .souve-auth-links,
    .souve-auth-flow .souve-auth-submit-wrap,
    .souve-auth-flow .souve-auth-desc {
        position: static;
    }
}

/* Souve Login widget ordering controls. Core auth fields stay owned by the Auth Engine. */
.souve-auth-flow.souve-auth-social-first [data-auth-step]{display:flex;flex-direction:column}
.souve-auth-flow.souve-auth-social-first [data-auth-step]>.souve-auth-title{order:0}
.souve-auth-flow.souve-auth-social-first [data-auth-step]>.souve-auth-desc{order:1}
.souve-auth-flow.souve-auth-social-first [data-auth-step]>.souve-auth-socials{order:5;margin-bottom:16px}
.souve-auth-flow.souve-auth-social-first [data-auth-step]>.souve-auth-notices{order:6}
.souve-auth-flow.souve-auth-social-first [data-auth-step]>.souve-auth-email-display{order:10}
.souve-auth-flow.souve-auth-social-first [data-auth-step]>.woocommerce-form-row:not(.souve-auth-email-display){order:20}
.souve-auth-flow.souve-auth-social-first [data-auth-step]>.woocommerce-privacy-policy-text{order:25}
.souve-auth-flow.souve-auth-social-first [data-auth-step]>.souve-auth-submit-wrap{order:30}
.souve-auth-flow.souve-auth-social-first [data-auth-step]>.souve-auth-links{order:40}
