/* ============================================================
   Hlal  Bot — Login Page  (Split-Screen Design)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ---- Tokens ---- */
:root {
    --brand:        #1a56db;
    --brand-dark:   #1344b4;
    --brand-light:  #3b82f6;
    --brand-glow:   rgba(26, 86, 219, 0.35);

    --surface:      #ffffff;
    --surface-2:    #f8fafc;
    --border:       #e2e8f0;
    --border-focus: #1a56db;

    --text-1:       #0f172a;
    --text-2:       #475569;
    --text-3:       #94a3b8;

    --error:        #dc2626;
    --success:      #16a34a;

    --radius-sm:    8px;
    --radius-md:    14px;
    --radius-lg:    20px;
    --radius-xl:    28px;

    --shadow-card:  0 4px 24px rgba(0,0,0,.08);
    --shadow-btn:   0 4px 16px rgba(26, 86, 219, .40);

    --ease:         cubic-bezier(.4, 0, .2, 1);
    --dur:          .22s;
}

/* ---- Body ---- */
html, body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    background: var(--surface);
    color: var(--text-1);
    overflow: hidden;
}

/* ============================================================
   LAYOUT — Two Panels
   ============================================================ */
body {
    display: flex;
}

.panel {
    flex: 1;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ============================================================
   LEFT PANEL
   ============================================================ */
.panel-left {
    background: linear-gradient(145deg, #0f172a 0%, #1e3a8a 55%, #1d4ed8 100%);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
}

.panel-left-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 52px;
    width: 100%;
    gap: 40px;
}

/* ---- Background Orbs ---- */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 1;
}
.orb-1 {
    width: 420px; height: 420px;
    background: rgba(59, 130, 246, .25);
    top: -120px; right: -100px;
    animation: drift 18s ease-in-out infinite;
}
.orb-2 {
    width: 320px; height: 320px;
    background: rgba(99, 102, 241, .20);
    bottom: -80px; left: -60px;
    animation: drift 24s ease-in-out infinite reverse;
}
.orb-3 {
    width: 200px; height: 200px;
    background: rgba(14, 165, 233, .18);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: drift 14s ease-in-out infinite 4s;
}
@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    33%       { transform: translate(24px, -20px); }
    66%       { transform: translate(-16px, 18px); }
}

/* ---- Brand ---- */
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.brand-icon {
    width: 48px; height: 48px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
}
.brand-icon i {
    font-size: 1.3rem;
    color: #fff;
}
/* Logo variant — white square background */
.brand-icon--logo {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
    padding: 8px;
    background: #ffffff;
    border: none;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.30);
    backdrop-filter: none;
    overflow: hidden;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.brand-logo-img {
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    object-fit: contain;
    display: block;
}
.brand-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .5px;
}

/* ---- Hero Text ---- */
.hero-text h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 16px;
}
.hero-text p {
    font-size: .95rem;
    color: rgba(255,255,255,.65);
    line-height: 1.7;
    max-width: 340px;
}

/* ---- Feature Pills ---- */
.feature-pills {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--radius-xl);
    color: rgba(255,255,255,.85);
    font-size: .85rem;
    font-weight: 500;
    width: fit-content;
    backdrop-filter: blur(6px);
    transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.pill:hover {
    background: rgba(255,255,255,.14);
    transform: translateX(4px);
}
.pill i {
    font-size: .9rem;
    color: #93c5fd;
}

/* ---- Floating Status Cards ---- */
.float-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius-md);
    backdrop-filter: blur(14px);
    z-index: 3;
    animation: floatCard 6s ease-in-out infinite;
}
.float-card-1 { bottom: 120px; right: 32px; animation-delay: 0s; }
.float-card-2 { bottom: 52px;  right: 32px; animation-delay: 1.5s; }
@keyframes floatCard {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}
.float-card-icon {
    width: 34px; height: 34px;
    background: rgba(255,255,255,.15);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    color: #fff;
}
.float-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.float-card-label { font-size: .72rem; color: rgba(255,255,255,.55); font-weight: 500; }
.float-card-value { font-size: .82rem; color: #fff; font-weight: 600; }
.float-card-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-left: auto;
}
.dot-green { background: #4ade80; box-shadow: 0 0 6px #4ade80; }

/* ============================================================
   RIGHT PANEL
   ============================================================ */
.panel-right {
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.form-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
    animation: fadeUp .5s var(--ease) both;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Top Meta ---- */
.top-meta {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 40px;
}
.version-tag {
    font-size: .72rem;
    font-weight: 600;
    color: var(--brand);
    background: rgba(26, 86, 219, .08);
    border: 1px solid rgba(26, 86, 219, .18);
    padding: 4px 10px;
    border-radius: 99px;
    letter-spacing: .5px;
    text-transform: uppercase;
}

/* ---- Form Header ---- */
.form-header {
    margin-bottom: 36px;
}
.form-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 6px;
}
.form-header p {
    font-size: .9rem;
    color: var(--text-2);
    font-weight: 400;
}

/* ---- Field Group ---- */
#login-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field-group label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: .2px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.forgot-link {
    font-size: .8rem;
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--dur) var(--ease);
}
.forgot-link:hover { color: var(--brand-dark); text-decoration: underline; }

/* ---- Input ---- */
.field-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-input-wrap input {
    width: 100%;
    padding: 13px 44px 13px 44px;
    font-size: .93rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-1);
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.field-input-wrap input::placeholder { color: var(--text-3); }
.field-input-wrap input:focus {
    border-color: var(--border-focus);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(26, 86, 219, .10);
}
.field-input-wrap input.input-error {
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, .08);
}

.field-icon {
    position: absolute;
    left: 14px;
    font-size: .9rem;
    color: var(--text-3);
    pointer-events: none;
    transition: color var(--dur) var(--ease);
}
.field-input-wrap input:focus ~ .field-icon,
.field-input-wrap:focus-within .field-icon { color: var(--brand); }

.toggle-pw {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-3);
    font-size: .9rem;
    padding: 4px;
    border-radius: 6px;
    transition: color var(--dur) var(--ease);
    display: flex; align-items: center;
}
.toggle-pw:hover { color: var(--brand); }

/* ---- Remember Row ---- */
.remember-row { margin-top: -6px; }

.custom-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.custom-check input { display: none; }
.check-box {
    width: 18px; height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--dur) var(--ease);
    flex-shrink: 0;
}
.custom-check input:checked + .check-box {
    background: var(--brand);
    border-color: var(--brand);
}
.custom-check input:checked + .check-box::after {
    content: '';
    width: 5px; height: 9px;
    border: 2px solid #fff;
    border-top: none; border-left: none;
    transform: rotate(45deg) translateY(-1px);
    display: block;
}
.check-label {
    font-size: .83rem;
    color: var(--text-2);
    font-weight: 500;
}

/* ---- Alert Box ---- */
.alert-box {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 500;
    background: rgba(220, 38, 38, .07);
    border: 1.5px solid rgba(220, 38, 38, .25);
    color: var(--error);
    animation: shake .4s var(--ease);
}
.alert-box.alert-success {
    background: rgba(22, 163, 74, .07);
    border-color: rgba(22, 163, 74, .25);
    color: var(--success);
}
.alert-icon { font-size: 1rem; flex-shrink: 0; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* ---- Submit Button ---- */
.submit-btn {
    margin-top: 4px;
    width: 100%;
    padding: 14px 24px;
    font-size: .95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: #fff;
    background: var(--brand);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    box-shadow: var(--shadow-btn);
}
.submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent);
    transform: translateX(-100%);
    transition: transform .5s var(--ease);
}
.submit-btn:hover::before { transform: translateX(100%); }
.submit-btn:hover {
    background: var(--brand-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--brand-glow);
}
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

.submit-label   { transition: opacity var(--dur) var(--ease); }
.submit-spinner { display: none; }
.submit-arrow   { font-size: .85rem; transition: transform var(--dur) var(--ease); }
.submit-btn:hover .submit-arrow { transform: translateX(4px); }

/* Loading state */
.submit-btn.is-loading .submit-label { opacity: 0; }
.submit-btn.is-loading .submit-spinner { display: flex; }
.submit-btn.is-loading .submit-arrow  { display: none; }

/* Success state */
.submit-btn.is-success {
    background: var(--success);
    box-shadow: 0 8px 24px rgba(22, 163, 74, .35);
}

/* ---- Footer ---- */
.form-footer {
    margin-top: 28px;
    text-align: center;
    font-size: .83rem;
    color: var(--text-3);
}
.form-footer a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
}
.form-footer a:hover { text-decoration: underline; }

/* ---- Security Note ---- */
.security-note {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: .75rem;
    color: var(--text-3);
}
.security-note i { color: var(--success); font-size: .8rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
    body { flex-direction: column; overflow: auto; }
    html, body { height: auto; }

    .panel-left {
        height: 260px;
        flex: none;
    }
    .panel-left-inner {
        padding: 32px 28px;
        gap: 20px;
    }
    .hero-text h1 { font-size: 1.5rem; }
    .hero-text p  { display: none; }
    .feature-pills { flex-direction: row; flex-wrap: wrap; }
    .float-card   { display: none; }

    .panel-right {
        flex: none;
        min-height: 100vh;
        padding: 24px 0;
    }
    .form-wrapper {
        padding: 32px 24px;
    }
}

@media (max-width: 400px) {
    .form-wrapper { padding: 24px 16px; }
}