/* ============================================
   B2B Login Page - MizbanPack Design System
   ============================================ */

/* Font Definitions */
@font-face {
    font-family: 'A-Light';
    src: url('../../assets/fonts/A-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'A-Bold';
    src: url('../../assets/fonts/A-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ===== CSS Variables (MizbanPack Design Tokens) ===== */
.b2b-login-page {
    --mz-primary: #00898a;
    --mz-primary-hover: #007677;
    --mz-primary-light: #e0f2f1;
    --mz-primary-dark: #005f60;
    --mz-text-main: #444444;
    --mz-text-dark: #212121;
    --mz-text-light: #757575;
    --mz-text-muted: #999999;
    --mz-white: #FFFFFF;
    --mz-bg: #ececec7a;
    --mz-border: #eeeeee;
    --mz-border-light: #f5f5f5;
    --mz-shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --mz-shadow-md: 0 4px 12px rgba(0,0,0,0.05);
    --mz-shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
    --mz-radius-sm: 8px;
    --mz-radius-md: 12px;
    --mz-radius-lg: 16px;
    --mz-radius-xl: 24px;
    --mz-transition: all 0.3s ease;
    --mz-font-main: 'A-Light', Tahoma, Arial, sans-serif;
    --mz-font-bold: 'A-Bold', Tahoma, Arial, sans-serif;
}

/* ===== Login Wrapper ===== */
.b2b-login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    grid-area: form;
}

.b2b-login-page {
    box-sizing: border-box;
    width: min(1240px, calc(100% - clamp(24px, 5vw, 72px))) !important;
    max-width: 1240px !important;
    margin: 8px auto 0;
    padding: 20px 20px 46px !important;
    border: 0;
    border-radius: 0;
    background: transparent;
}

body:has(.b2b-login-page) #mz-main-content {
    padding-top: 12px;
}

.b2b-auth-stage {
    display:grid;
    grid-template-columns:minmax(420px,560px) minmax(260px,330px);
    grid-template-areas:"form switch";
    justify-content:center;
    align-items:start;
    gap:clamp(28px,5vw,72px);
    direction:ltr;
}

.b2b-login-page--register .b2b-auth-stage {
    grid-template-columns:minmax(600px,720px) minmax(260px,330px);
}

.b2b-login-page--register .b2b-login-wrapper {
    max-width:720px;
}

.b2b-auth-switch {
    grid-area:switch;
    direction:rtl;
    padding:28px;
    border:1px solid #dce8e6;
    border-radius:18px;
    color:#173f43;
    background:#f3f9f7;
    align-self:start;
    margin-top:190px;
}

.b2b-auth-switch-kicker {
    display:inline-flex;
    margin-bottom:12px;
    padding:5px 10px;
    border-radius:999px;
    color:#087f80;
    background:#e3f2ee;
    font-size:11px;
    font-family:var(--mz-font-bold);
}

.b2b-auth-switch h2 {
    margin:0 0 10px;
    color:#173f43;
    font-size:1.08rem;
    line-height:1.7;
}

.b2b-auth-switch p {
    margin:0 0 20px;
    color:#647574;
    font-size:12.5px;
    line-height:2;
}

.b2b-auth-switch-btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:9px;
    min-height:42px;
    padding:9px 16px;
    border:1px solid #9bcac3;
    border-radius:12px;
    color:#087f80;
    background:#fff;
    font-family:var(--mz-font-bold);
    font-size:12.5px;
    text-decoration:none;
    transition:border-color .2s ease,background-color .2s ease;
}

.b2b-auth-switch-btn:hover {
    border-color:#087f80;
    background:#e8f5f2;
}

.b2b-auth-switch-btn svg {
    width:18px;
    height:18px;
    stroke-width:1.7;
    stroke-linecap:round;
    stroke-linejoin:round;
}

/* ===== Login Card (Glassmorphism) ===== */
.b2b-login-card {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: var(--mz-radius-lg);
    padding: 1.75rem 2rem 2rem;
    box-shadow: none;
    border: 1px solid #dce8e6;
}

/* ===== Brand Section ===== */
.b2b-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.b2b-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 4px;
}

.b2b-brand-logo img {
    height: 40px;
    width: auto;
}

.b2b-brand-subtitle {
    font-size: 14px;
    color: var(--mz-text-light);
    margin-top: 4px;
}

.b2b-brand-badge {
    display: inline-block;
    background: var(--mz-primary-light);
    color: var(--mz-primary);
    font-family: var(--mz-font-bold);
    font-size: 10px;
    padding: 2px 12px;
    border-radius: 20px;
    margin-top: 6px;
    letter-spacing: 0.5px;
}

/* ===== Alert Messages ===== */
.b2b-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--mz-radius-md);
    margin-bottom: 1.25rem;
    font-size: 13px;
    line-height: 1.7;
}

.b2b-alert-danger {
    background: #fef2f2;
    border-right: 4px solid #dc2626;
    color: #991b1b;
}

.b2b-alert-danger .b2b-alert-icon {
    color: #dc2626;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.b2b-alert-success {
    background: #f0fdf4;
    border-right: 4px solid #16a34a;
    color: #166534;
}

.b2b-alert-success .b2b-alert-icon {
    color: #16a34a;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

/* ===== Form Styles ===== */
.b2b-form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.b2b-form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--mz-text-dark);
    margin-bottom: 8px;
    font-family: var(--mz-font-bold);
}

.b2b-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.b2b-form-control {
    width: 100%;
    padding: 14px 48px 14px 16px;
    font-size: 14px;
    font-family: var(--mz-font-main);
    color: var(--mz-text-dark);
    border: 1.5px solid #e2e8f0;
    border-radius: var(--mz-radius-md);
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.25s ease;
    outline: none;
}

.b2b-form-control:focus {
    border-color: var(--mz-primary);
    background: var(--mz-white);
    outline: none;
}

.b2b-form-control::placeholder {
    color: #a0aec0;
    font-weight: 300;
}

.b2b-form-control.error {
    border-color: #dc2626;
}

.b2b-input-icon {
    position: absolute;
    right: 16px;
    width: 20px;
    height: 20px;
    color: #94a3b8;
    pointer-events: none;
    stroke-width: 1.8;
}

/* ===== Password Toggle ===== */
.b2b-password-toggle {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.b2b-password-toggle:hover {
    color: var(--mz-text-light);
}

.b2b-password-toggle svg {
    width: 18px;
    height: 18px;
}

.b2b-input-wrapper:has(.b2b-password-toggle) .b2b-form-control {
    padding-left: 50px;
}

/* ===== CAPTCHA Section ===== */
.b2b-captcha-section {
    margin-bottom: 1.5rem;
}

.b2b-captcha-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.b2b-captcha-image-box {
    flex-shrink: 0;
    background: #f8fafc;
    border-radius: var(--mz-radius-md);
    padding: 6px;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.b2b-captcha-image-box img {
    display: block;
    height: 50px;
    width: auto;
    border-radius: 8px;
}

.b2b-captcha-refresh-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 8px;
}

.b2b-captcha-image-box:hover .b2b-captcha-refresh-hint {
    opacity: 1;
}

.b2b-captcha-input {
    flex: 1;
    direction: ltr;
    text-align: center;
    letter-spacing: 3px;
    font-family: 'A-Light', monospace, Tahoma, sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.b2b-captcha-hint {
    font-size: 11px;
    color: var(--mz-text-muted);
    margin-top: 8px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.b2b-captcha-hint svg {
    width: 14px;
    height: 14px;
    color: var(--mz-text-muted);
}

/* ===== Submit Button ===== */
.b2b-btn-submit {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-family: var(--mz-font-bold);
    font-weight: 700;
    border: none;
    border-radius: var(--mz-radius-md);
    background: var(--mz-primary);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.b2b-btn-submit,
.b2b-btn-submit .b2b-btn-text,
.b2b-btn-submit span {
    color: #ffffff !important;
}

.b2b-btn-submit:hover {
    background: var(--mz-primary-hover);
}

.b2b-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.b2b-btn-submit svg {
    width: 20px;
    height: 20px;
    color: var(--mz-white) !important;
}

/* Loading Spinner */
.b2b-btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.b2b-btn-submit.loading .b2b-btn-text {
    display: none;
}

.b2b-btn-submit.loading .b2b-btn-spinner {
    display: block;
}

.b2b-btn-submit.loading .b2b-btn-icon {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Attempts Warning ===== */
.b2b-attempts-warning {
    font-size: 12px;
    color: #dc2626;
    text-align: center;
    margin-top: 16px;
    font-family: var(--mz-font-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ===== Two-Column Row Layout ===== */
.b2b-row {
    display: flex;
    gap: 12px;
}

.b2b-col {
    flex: 1;
    min-width: 0;
}

/* ===== Account Type Toggle ===== */
.b2b-toggle-group {
    display: flex;
    gap: 10px;
    background: #f1f5f9;
    border-radius: var(--mz-radius-md);
    padding: 4px;
}

.b2b-toggle-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--mz-font-main);
    color: var(--mz-text-light);
    transition: all 0.2s;
    user-select: none;
}

.b2b-toggle-option input[type="radio"] {
    display: none;
}

.b2b-toggle-option.active {
    background: var(--mz-white);
    color: var(--mz-primary);
    font-family: var(--mz-font-bold);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.b2b-toggle-option:hover:not(.active) {
    color: var(--mz-text-dark);
}

.b2b-toggle-icon {
    width: 18px;
    height: 18px;
}

/* ===== Register Link ===== */
.b2b-register-link {
    text-align: center;
    margin-top: 20px;
    padding: 14px 0 0;
    font-size: 13px;
    color: var(--mz-text-light);
}

.b2b-register-link a {
    color: var(--mz-primary);
    font-family: var(--mz-font-bold);
    font-weight: 700;
    text-decoration: none;
    margin-right: 4px;
}

.b2b-register-link a:hover {
    color: var(--mz-primary-hover);
    text-decoration: underline;
}

/* ===== Footer Links ===== */
.b2b-login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--mz-border);
}

.b2b-login-footer a {
    color: var(--mz-text-light);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.b2b-login-footer a:hover {
    color: var(--mz-primary);
}

.b2b-login-footer a svg {
    width: 16px;
    height: 16px;
}

/* ===== Responsive ===== */
/* Tablet */
@media (max-width: 768px) {
    .b2b-auth-stage,
    .b2b-login-page--register .b2b-auth-stage {
        grid-template-columns:minmax(0,1fr);
        grid-template-areas:"form" "switch";
        gap:16px;
    }
    .b2b-auth-switch {
        width:100%;
        max-width:440px;
        margin-inline:auto;
        margin-top:0;
        padding:20px;
    }
    .b2b-login-page--register .b2b-auth-switch { max-width:720px; }
    .b2b-login-wrapper {
        max-width: 400px;
    }
    .b2b-login-page--register .b2b-login-wrapper { max-width:720px; }
    
    .b2b-login-card {
        padding: 1.5rem 1.75rem 1.75rem;
    }
    
    .b2b-form-group {
        margin-bottom: 1.25rem;
    }
}

/* Mobile */
@media (max-width: 520px) {
    .b2b-login-wrapper {
        max-width: 100%;
        margin: 0.75rem;
    }

    .b2b-login-card {
        padding: 1.25rem 1.25rem 1.5rem;
        border-radius: var(--mz-radius-md);
    }

    .b2b-brand {
        margin-bottom: 1.25rem;
    }

    .b2b-brand-logo img {
        height: 36px;
    }

    .b2b-brand-subtitle {
        font-size: 13px;
    }

    .b2b-row {
        flex-direction: column;
        gap: 0;
    }

    .b2b-captcha-row {
        flex-direction: column;
    }

    .b2b-captcha-image-box {
        align-self: center;
    }

    .b2b-captcha-input {
        width: 100%;
    }

    .b2b-form-control {
        padding: 12px 44px 12px 14px;
        font-size: 13px;
    }
    
    .b2b-form-group {
        margin-bottom: 1rem;
    }
    
    .b2b-captcha-section {
        margin-bottom: 1rem;
    }
    
    .b2b-btn-submit {
        padding: 13px 20px;
        font-size: 14px;
    }
    
    .b2b-login-footer {
        margin-top: 18px;
        padding-top: 16px;
    }
}

/* Small Mobile */
@media (max-width: 380px) {
    .b2b-login-card {
        padding: 1rem 0.875rem 1.25rem;
    }
    
    .b2b-brand-logo img {
        height: 32px;
    }
    
    .b2b-brand-badge {
        font-size: 9px;
        padding: 1px 10px;
    }
}

/* ===== RTL Specific Adjustments ===== */
.b2b-input-icon {
    right: 16px;
    left: auto;
}

.b2b-password-toggle {
    left: 14px;
    right: auto;
}

.b2b-form-control {
    padding: 14px 48px 14px 16px;
}
/* Inset authentication surface, scoped to the login page only. */
.b2b-login-page .b2b-login-card { border-radius:18px; animation:b2bCardIn .5s cubic-bezier(.2,.8,.2,1) both; }
.b2b-login-page .b2b-login-btn { border-radius:12px !important; background:#087f80 !important; box-shadow:none !important; transition:background-color .2s ease !important; }
.b2b-login-page .b2b-login-btn:hover { background:#076c6d !important; }
.b2b-form-control { border-radius:14px !important; }
@keyframes b2bCardIn { from{opacity:0;transform:translateY(24px) scale(.985)} to{opacity:1;transform:none} }
@media(max-width:520px){body:has(.b2b-login-page) #mz-main-content{padding-top:8px}.b2b-login-page{width:calc(100% - 20px)!important;margin-top:4px;padding:14px 0 34px!important}.b2b-login-wrapper{width:100%}.b2b-login-card{padding:1.4rem 1.1rem}}
@media(prefers-reduced-motion:reduce){.b2b-login-card{animation:none}}

/* Unified corner system */
.b2b-login-page{--b2b-surface-radius:18px;--b2b-control-radius:12px}
.b2b-login-page .b2b-login-card{border-radius:var(--b2b-surface-radius)!important}
.b2b-login-page :is(.b2b-login-btn,.b2b-btn-submit,.b2b-form-control,input:not([type="radio"]):not([type="checkbox"]),select,textarea,button){border-radius:var(--b2b-control-radius)!important}
.b2b-login-card h1{font-size:1.75rem!important;line-height:1.55!important}.b2b-login-card h2{font-size:1.4rem!important;line-height:1.6!important}.b2b-login-card h3{font-size:1.12rem!important}
.b2b-otp-card { max-width: 460px; margin-inline: auto; }
.b2b-otp-description { color: var(--b2b-text-muted); text-align: center; line-height: 2; margin: 0 0 22px; }
.b2b-otp-input { direction: ltr; text-align: center; letter-spacing: .55em; font-size: 1.2rem; font-weight: 700; }
.b2b-otp-resend { text-align: center; margin-top: 16px; }
.b2b-otp-resend button { border: 0; background: transparent; color: var(--b2b-primary); cursor: pointer; font: inherit; font-weight: 700; }
