/**
 * XeroHub - Tenant Login Page CSS
 * Split layout: branded panel (left) + form (right)
 * Responsive: stacks vertically on mobile
 *
 * @package    XeroHub Tenants
 * @version    1.0.0
 * @updated    2026-04-05 - Initial build: split layout, tenant branding support,
 *                          RTL support, mobile responsive.
 */

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

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: #f1f5f9;
    display: flex;
    align-items: stretch;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
}

/* ============================================================
   WRAPPER
   ============================================================ */

.login-wrap {
    display: flex;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ============================================================
   BRANDED PANEL (Left)
   ============================================================ */

.login-brand {
    flex: 1;
    background: linear-gradient(135deg, #185FA5 0%, #0c3d6e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
    color: #fff;
}

/* Decorative circles */
.login-brand::before,
.login-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
}

.login-brand::before {
    width: 420px;
    height: 420px;
    top: -100px;
    left: -120px;
}

.login-brand::after {
    width: 300px;
    height: 300px;
    bottom: -80px;
    right: -80px;
}

.login-brand__inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 360px;
}

.login-brand__logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 1.5rem;
    border-radius: 16px;
    background: rgba(255,255,255,.12);
    padding: 10px;
}

.login-brand__logo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: rgba(255,255,255,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 1.5rem;
}

.login-brand__welcome {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255,255,255,.7);
    margin: 0 0 8px;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.login-brand__name {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 1rem;
    line-height: 1.2;
}

.login-brand__tagline {
    font-size: 14px;
    color: rgba(255,255,255,.65);
    margin: 0;
    line-height: 1.6;
}

.login-brand__divider {
    width: 40px;
    height: 3px;
    background: rgba(255,255,255,.35);
    border-radius: 99px;
    margin: 1.25rem auto;
}

/* Wave decoration */
.login-brand__wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: .15;
}

/* ============================================================
   FORM PANEL (Right)
   ============================================================ */

.login-form-panel {
    width: 480px;
    flex-shrink: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.75rem;
    overflow-y: auto;
}

.login-form-panel__inner {
    width: 100%;
    max-width: 360px;
}

/* Header */
.login-form-header {
    margin-bottom: 2rem;
}

.login-form-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px;
}

.login-form-header p {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

/* Language */
.login-lang {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

[dir="rtl"] .login-lang { justify-content: flex-start; }

.login-lang__wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: .5px solid #e2e8f0;
    border-radius: 99px;
    padding: 5px 14px 5px 10px;
    transition: border-color .15s, box-shadow .15s;
}

.login-lang__wrap:focus-within {
    border-color: #185FA5;
    box-shadow: 0 0 0 3px rgba(24,95,165,.1);
}

.login-lang__icon  { font-size: 13px; color: #185FA5; flex-shrink: 0; }
.login-lang__arrow { position: absolute; right: 10px; font-size: 10px; color: #94a3b8; pointer-events: none; }
[dir="rtl"] .login-lang__arrow { right: auto; left: 10px; }

.login-lang__select {
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 16px;
}

/* Alerts */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.login-alert i { flex-shrink: 0; margin-top: 2px; }

.login-alert--error   { background: rgba(248,113,113,.1); border: .5px solid rgba(220,38,38,.3);  color: #b91c1c; }
.login-alert--warning { background: rgba(251,191,36,.1);  border: .5px solid rgba(217,119,6,.3);  color: #92400e; }
.login-alert--success { background: rgba(34,197,94,.1);   border: .5px solid rgba(22,163,74,.3);  color: #166534; }
.login-alert--info    { background: rgba(59,130,246,.1);  border: .5px solid rgba(37,99,235,.3);  color: #1d4ed8; }

/* Form */
.login-form .form-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    display: block;
}

.login-form .form-label i { margin-right: 5px; }
[dir="rtl"] .login-form .form-label i { margin-right: 0; margin-left: 5px; }

.login-form .form-control {
    width: 100%;
    border: .5px solid #e2e8f0;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}

.login-form .form-control:focus {
    border-color: #185FA5;
    box-shadow: 0 0 0 3px rgba(24,95,165,.12);
}

/* Password toggle */
.pw-field { position: relative; }
.pw-field .form-control { padding-right: 42px; }
[dir="rtl"] .pw-field .form-control { padding-right: 14px; padding-left: 42px; }

.pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #adb5bd;
    font-size: 16px;
    line-height: 1;
    padding: 4px;
    user-select: none;
}

[dir="rtl"] .pw-toggle { right: auto; left: 12px; }
.pw-toggle:hover { color: #6c757d; }

/* Remember me */
.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 13px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    color: #374151;
    user-select: none;
}

.login-remember input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #185FA5;
    cursor: pointer;
}

/* Submit */
.login-btn {
    width: 100%;
    padding: 12px;
    background: #185FA5;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    letter-spacing: .3px;
}

.login-btn:hover  { background: #0c4a84; }
.login-btn:active { transform: scale(.99); }

.login-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Footer */
.login-form-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 12px;
    color: #94a3b8;
}

/* Security badge */
.login-security {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.dev-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    background: rgba(255,193,7,.1);
    color: #b45309;
    border: .5px solid rgba(217,119,6,.3);
    border-radius: 99px;
    padding: 3px 12px;
    font-size: 11px;
}

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */

@media (max-width: 768px) {
    .login-wrap {
        flex-direction: column;
    }

    .login-brand {
        flex: none;
        min-height: 220px;
        padding: 2rem 1.5rem;
    }

    .login-brand__name   { font-size: 22px; }
    .login-brand__logo   { width: 60px; height: 60px; margin-bottom: 1rem; }
    .login-brand__logo-placeholder { width: 60px; height: 60px; font-size: 24px; margin-bottom: 1rem; }
    .login-brand__tagline { display: none; }

    .login-form-panel {
        width: 100%;
        padding: 2rem 1.5rem;
        justify-content: flex-start;
    }

    .login-form-panel__inner { max-width: 100%; }
}

@media (max-width: 480px) {
    .login-brand { min-height: 180px; padding: 1.5rem 1rem; }
    .login-form-panel { padding: 1.5rem 1.25rem; }
}
