/* ============================================
   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) ===== */
:root {
    --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: 2rem auto;
}

/* ===== Login Card (Glassmorphism) ===== */
.b2b-login-card {
    background: #ffffff3d;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--mz-radius-lg);
    padding: 1.75rem 2rem 2rem;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.06),
        0 8px 20px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

/* ===== 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;
}

/* ===== 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-login-wrapper {
        max-width: 400px;
    }
    
    .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;
}
