/**
 * Bee1 Universal Login Styles
 * Studio Bee1 Official - Navy Blue + Gold
 * Version: 1.4.0 - Added OTP step, lostpassword, resetpass, info alerts
 */

:root {
    --bee1-navy: #0a1428;
    --bee1-navy-light: #13213d;
    --bee1-navy-lighter: #1e2e4f;
    --bee1-gold: #C9A227;
    --bee1-gold-dark: #A67C00;
    --bee1-gold-light: #D4B52E;
    --bee1-white: #ffffff;
    --bee1-gray-50: #fafafa;
    --bee1-gray-100: #f5f5f5;
    --bee1-gray-200: #e8e8e8;
    --bee1-gray-600: #666666;
    --bee1-gray-800: #333333;
    --bee1-text-on-navy: rgba(255, 255, 255, 0.95);
    --bee1-text-on-navy-dim: rgba(255, 255, 255, 0.7);
}

/* Reset */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
    overflow: hidden;
}

body.bee1-login-page {
    font-family: 'Rubik', system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bee1-navy);
    color: var(--bee1-gray-800);
    height: 100vh;
    overflow: hidden;
}

body.bee1-rtl {
    direction: rtl;
}

body.bee1-ltr {
    direction: ltr;
}

/* Container - Form on RIGHT in RTL, LEFT in LTR */
.bee1-login-container {
    display: flex;
    height: 100vh;
    width: 100%;
    /* In RTL: form (first DOM element) appears on right, visual on left. Reverse for LTR. */
}

body.bee1-ltr .bee1-login-container {
    flex-direction: row-reverse;
}

/* ============ FORM SIDE ============ */
.bee1-login-form-side {
    flex: 0 0 45%;
    background: var(--bee1-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 50px;
    height: 100vh;
    overflow-y: auto;
}

.bee1-login-form-wrapper {
    width: 100%;
    max-width: 420px;
}

.bee1-site-logo {
    margin-bottom: 24px;
    text-align: center;
}

.bee1-site-logo img {
    max-height: 60px;
    max-width: 200px;
    width: auto;
    height: auto;
}

.bee1-form-title {
    color: var(--bee1-navy);
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 6px 0;
    letter-spacing: -0.5px;
}

.bee1-form-subtitle {
    color: var(--bee1-gray-600);
    font-size: 1rem;
    margin: 0 0 24px 0;
    font-weight: 400;
}

/* Alerts */
.bee1-alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 0.95rem;
    font-weight: 500;
}

.bee1-alert-error {
    background: #fef2f2;
    color: #dc2626;
    border-right: 4px solid #dc2626;
}
body.bee1-ltr .bee1-alert-error {
    border-right: none;
    border-left: 4px solid #dc2626;
}

.bee1-alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border-right: 4px solid #16a34a;
}
body.bee1-ltr .bee1-alert-success {
    border-right: none;
    border-left: 4px solid #16a34a;
}

/* Form */
.bee1-form-group {
    margin-bottom: 16px;
}

.bee1-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--bee1-navy);
    font-size: 0.9rem;
}

.bee1-input {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid var(--bee1-gray-200);
    border-radius: 10px;
    font-size: 0.98rem;
    font-family: inherit;
    background: var(--bee1-gray-50);
    color: var(--bee1-gray-800);
    box-sizing: border-box;
    transition: all 0.25s ease;
}

.bee1-input:focus {
    outline: none;
    border-color: var(--bee1-gold);
    background: var(--bee1-white);
    box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.12);
}

.bee1-input::placeholder {
    color: #aaa;
}

/* Password field */
.bee1-password-field {
    position: relative;
}

body.bee1-rtl .bee1-password-field .bee1-input {
    padding-left: 44px;
}
body.bee1-ltr .bee1-password-field .bee1-input {
    padding-right: 44px;
}

.bee1-toggle-password {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

body.bee1-rtl .bee1-toggle-password {
    left: 10px;
}
body.bee1-ltr .bee1-toggle-password {
    right: 10px;
}

.bee1-toggle-password:hover {
    color: var(--bee1-gold-dark);
    background: rgba(201, 162, 39, 0.08);
}

/* Form Options */
.bee1-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 14px 0 20px;
    font-size: 0.92rem;
}

.bee1-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--bee1-gray-800);
    user-select: none;
}

.bee1-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--bee1-gold);
    cursor: pointer;
}

.bee1-forgot-link {
    color: var(--bee1-gold-dark);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.bee1-forgot-link:hover {
    color: var(--bee1-gold);
    text-decoration: underline;
}

/* Submit Button */
.bee1-login-button {
    width: 100%;
    background: linear-gradient(135deg, var(--bee1-gold) 0%, var(--bee1-gold-dark) 100%);
    color: var(--bee1-white);
    border: none;
    padding: 14px 22px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(201, 162, 39, 0.28);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.bee1-login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(201, 162, 39, 0.4);
    background: linear-gradient(135deg, var(--bee1-gold-light) 0%, var(--bee1-gold) 100%);
}

.bee1-login-button:active {
    transform: translateY(0);
}

.bee1-login-button svg {
    transition: transform 0.3s ease;
}

body.bee1-rtl .bee1-login-button svg {
    transform: scaleX(-1);
}

.bee1-login-button:hover svg {
    transform: translateX(4px);
}

body.bee1-rtl .bee1-login-button:hover svg {
    transform: scaleX(-1) translateX(4px);
}

/* Footer */
.bee1-login-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--bee1-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.bee1-back-link {
    color: var(--bee1-gray-600);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.bee1-back-link:hover {
    color: var(--bee1-navy);
}

.bee1-powered-by {
    color: var(--bee1-gray-600);
    margin: 0;
    font-size: 0.82rem;
}

.bee1-powered-by strong {
    color: var(--bee1-gold-dark);
    font-weight: 700;
}

/* ============ VISUAL SIDE (Brand) ============ */
.bee1-login-visual-side {
    flex: 1;
    background: linear-gradient(135deg, var(--bee1-navy) 0%, var(--bee1-navy-light) 60%, var(--bee1-navy-lighter) 100%);
    position: relative;
    overflow: hidden;
    color: var(--bee1-text-on-navy);
    height: 100vh;
}

.bee1-visual-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 25%, rgba(201, 162, 39, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 85% 75%, rgba(212, 181, 46, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(166, 124, 0, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

.bee1-visual-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(201, 162, 39, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 162, 39, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.6;
}

.bee1-visual-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 45px 55px;
    justify-content: space-between;
    box-sizing: border-box;
}

/* Brand Header (top) */
.bee1-brand-header {
    flex: 0 0 auto;
}

.bee1-brand-logo-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(201, 162, 39, 0.2);
    border-radius: 16px;
    backdrop-filter: blur(6px);
}

.bee1-brand-icon {
    font-size: 2.4rem;
    line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(201, 162, 39, 0.5));
}

.bee1-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.bee1-brand-studio {
    color: var(--bee1-text-on-navy-dim);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.bee1-brand-name {
    color: var(--bee1-gold);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-top: 4px;
}

/* Hero Text (CENTER of visual side - fills the space!) */
.bee1-visual-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 560px;
    padding: 30px 0;
}

.bee1-visual-hero h2 {
    color: var(--bee1-white);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 22px 0;
    letter-spacing: -0.5px;
}

.bee1-visual-hero .bee1-highlight {
    color: var(--bee1-gold);
    background: linear-gradient(135deg, var(--bee1-gold-light), var(--bee1-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bee1-visual-hero p {
    color: var(--bee1-text-on-navy-dim);
    font-size: 1.15rem;
    line-height: 1.65;
    margin: 0;
    font-weight: 400;
}

/* Stats Footer */
.bee1-visual-footer {
    flex: 0 0 auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bee1-visual-stats {
    display: flex;
    gap: 40px;
    align-items: center;
}

.bee1-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bee1-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--bee1-gold);
    letter-spacing: -0.5px;
    line-height: 1;
}

.bee1-stat-label {
    font-size: 0.85rem;
    color: var(--bee1-text-on-navy-dim);
    font-weight: 500;
}

/* ============ OTP / 2FA step ============ */
.bee1-alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-right: 4px solid #3b82f6;
}
body.bee1-ltr .bee1-alert-info {
    border-right: none;
    border-left: 4px solid #3b82f6;
}

.bee1-alert-info strong {
    color: var(--bee1-gold-dark);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.bee1-otp-input {
    text-align: center;
    letter-spacing: 12px;
    font-size: 1.5rem !important;
    font-weight: 700;
    padding: 16px !important;
    font-family: 'Rubik', system-ui, monospace;
}

.bee1-form-description {
    margin: 8px 0 0;
    color: var(--bee1-gray-600);
    font-size: 0.85rem;
    line-height: 1.5;
}

.bee1-input-with-action {
    position: relative;
}

.bee1-input-readonly {
    background: var(--bee1-gray-100) !important;
    color: var(--bee1-gray-600) !important;
    cursor: not-allowed;
}

body.bee1-rtl .bee1-input-readonly {
    padding-left: 75px;
}
body.bee1-ltr .bee1-input-readonly {
    padding-right: 75px;
}

.bee1-change-user-badge {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bee1-gold-dark);
    color: var(--bee1-white);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

body.bee1-rtl .bee1-change-user-badge {
    left: 10px;
}
body.bee1-ltr .bee1-change-user-badge {
    right: 10px;
}

.bee1-change-user-badge:hover {
    background: var(--bee1-gold);
    color: var(--bee1-white);
}

/* ============ RESPONSIVE ============ */
@media (max-height: 700px) {
    .bee1-visual-hero h2 { font-size: 2.2rem; }
    .bee1-visual-hero p { font-size: 1rem; }
    .bee1-form-title { font-size: 1.7rem; }
    .bee1-site-logo img { max-height: 50px; }
    .bee1-visual-content { padding: 30px 40px; }
    .bee1-login-form-side { padding: 20px 40px; }
    .bee1-stat-value { font-size: 1.4rem; }
}

/* Tablet / Mobile - STACKED LAYOUT */
@media (max-width: 900px) {
    html, body {
        overflow: auto;
    }

    body.bee1-login-page {
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .bee1-login-container,
    body.bee1-ltr .bee1-login-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .bee1-login-form-side {
        flex: 0 0 auto;
        height: auto;
        padding: 30px 25px;
        order: 1; /* Form appears FIRST on mobile */
    }

    .bee1-login-visual-side {
        flex: 0 0 auto;
        height: auto;
        min-height: 280px;
        order: 2;
    }

    .bee1-visual-content {
        padding: 30px 25px;
    }

    .bee1-visual-hero h2 {
        font-size: 1.8rem;
    }

    .bee1-visual-hero p {
        font-size: 0.98rem;
    }

    .bee1-visual-stats {
        gap: 25px;
    }

    .bee1-stat-value {
        font-size: 1.4rem;
    }

    .bee1-stat-label {
        font-size: 0.78rem;
    }

    .bee1-form-title {
        font-size: 1.7rem;
    }
}

@media (max-width: 480px) {
    .bee1-login-form-side {
        padding: 25px 18px;
    }

    .bee1-visual-content {
        padding: 25px 18px;
    }

    .bee1-login-visual-side {
        min-height: 220px;
    }

    .bee1-form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .bee1-login-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .bee1-visual-stats {
        justify-content: space-between;
        width: 100%;
        gap: 15px;
    }

    .bee1-brand-name {
        font-size: 1.5rem;
    }
}
