/* ═══════════════════════════════════════════════════════
   Login — Green analytics panel + credentials form
   ═══════════════════════════════════════════════════════ */

@keyframes uf-grow {
    from { transform: scaleY(0.15); }
    to   { transform: scaleY(1); }
}

@keyframes uf-fade {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

:root {
    --g:      #78b943;
    --g-dark: #6aa537;
    --g-deep: #5e9433;
    --g-glow: rgba(120, 185, 67, 0.18);
}

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

body {
    margin: 0;
    font-family: 'Manrope', system-ui, sans-serif;
    background: #f6f7f3;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #1f2419;
}

/* ── Main layout ── */
.login-body {
    flex: 1;
    display: flex;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════
   Left — Brand / Analytics panel
   ═══════════════════════════════════════════════════════ */
.brand-panel {
    flex: 1 1 52%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(155deg, #6aa537 0%, #78b943 45%, #8cc850 100%);
    display: flex;
    flex-direction: column;
    padding: 56px 60px;
    min-width: 0;
}

.brand-panel__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 46px 46px;
    pointer-events: none;
}

.brand-panel__glow {
    position: absolute;
    top: -160px;
    inset-inline-end: -120px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
    pointer-events: none;
}

/* Brand mark */
.brand-mark {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo-wrap {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.brand-logo-wrap img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 12px;
}

.brand-name {
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.2px;
    line-height: 1;
}

.brand-platform {
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    margin-top: 5px;
}

/* Headline */
.brand-headline {
    position: relative;
    margin-top: auto;
    animation: uf-fade .7s ease both;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 7px 14px;
    border-radius: 999px;
}

.brand-h1 {
    color: #fff;
    font-weight: 800;
    font-size: 40px;
    line-height: 1.14;
    margin: 22px 0 0;
    max-width: 480px;
    letter-spacing: -0.5px;
}

.brand-sub {
    color: rgba(255, 255, 255, 0.82);
    font-size: 15.5px;
    line-height: 1.65;
    margin: 18px 0 0;
    max-width: 440px;
    font-weight: 500;
}

/* Analytics card */
.analytics-card {
    position: relative;
    margin-top: 36px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    padding: 22px 24px;
    backdrop-filter: blur(6px);
    max-width: 480px;
    animation: uf-fade .9s ease both;
}

.analytics-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
    gap: 12px;
}

.analytics-card__label {
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.analytics-card__value {
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.analytics-card__delta {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.18);
    padding: 3px 8px;
    border-radius: 6px;
}

.analytics-card__chart-icon {
    color: rgba(255, 255, 255, 0.55);
    font-size: 22px;
}

.analytics-bars {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 88px;
}

.analytics-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
    justify-content: flex-end;
}

.analytics-bar {
    width: 100%;
    height: var(--h);
    background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.62));
    border-radius: 6px 6px 3px 3px;
    transform-origin: bottom;
    animation: uf-grow .9s cubic-bezier(.2, .7, .3, 1) both;
}

.analytics-bar-col span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════
   Right — Form panel
   ═══════════════════════════════════════════════════════ */
.form-panel {
    flex: 1 1 48%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: #fff;
    min-width: 0;
}

.form-panel__inner {
    width: 100%;
    max-width: 404px;
    animation: uf-fade .6s ease both;
}

/* Lang toggle */
.lang-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.lang-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1.5px solid #dfe3d6;
    border-radius: 999px;
    padding: 8px 15px;
    font-family: 'Manrope', system-ui, sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: #3a4031;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .18s, background .18s;
}

.lang-toggle-btn i {
    font-size: 15px;
    color: #5e9433;
}

.lang-toggle-btn:hover {
    background: rgba(120, 185, 67, 0.10);
    border-color: var(--g);
    color: #3a4031;
}

/* Form head */
.form-head {
    margin-bottom: 28px;
}

.form-title {
    font-weight: 800;
    font-size: 27px;
    margin: 0;
    letter-spacing: -0.4px;
    color: #1f2419;
    line-height: 1.2;
}

.form-subtitle {
    color: #6b7261;
    font-size: 14.5px;
    margin: 9px 0 0;
    font-weight: 500;
    line-height: 1.55;
}

/* Alert */
.form-alert {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    border-radius: .6rem;
    font-size: .85rem;
    margin-bottom: 1.25rem;
    font-weight: 500;
}

.form-alert i { font-size: 1rem; flex-shrink: 0; }

.form-alert--danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

/* Destination selector */
.dest-group {
    margin-bottom: 22px;
}

.dest-label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #3a4031;
    letter-spacing: 0.3px;
    margin-bottom: 9px;
}

.dest-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.dest-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: start;
    gap: 3px;
    padding: 15px 16px;
    border-radius: 14px;
    cursor: pointer;
    font-family: 'Manrope', system-ui, sans-serif;
    border: 1.5px solid #dfe3d6;
    background: #fcfdfb;
    color: #6b7261;
    transition: border-color .18s, background .18s, box-shadow .18s, color .18s;
}

.dest-card:hover {
    border-color: var(--g);
}

.dest-card--active {
    border-color: var(--g);
    background: linear-gradient(160deg, rgba(120, 185, 67, 0.12), rgba(120, 185, 67, 0.05));
    color: #3f6b1f;
    box-shadow: 0 4px 14px rgba(120, 185, 67, 0.18);
}

.dest-card__icon {
    font-size: 19px;
}

.dest-card__title {
    font-weight: 700;
    font-size: 14.5px;
}

.dest-card__sub {
    font-size: 11.5px;
    font-weight: 600;
    opacity: .72;
}

/* Fields */
.field-group {
    margin-bottom: 17px;
}

.field-label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #3a4031;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.field-wrap {
    position: relative;
}

.field-ico {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #9aa18c;
    font-size: 17px;
    pointer-events: none;
    z-index: 2;
    line-height: 1;
}

[dir="rtl"] .field-ico {
    left: auto;
    right: 15px;
}

.field-input {
    display: block;
    width: 100%;
    height: 50px;
    border: 1.5px solid #dfe3d6;
    border-radius: 12px;
    font-size: 14.5px;
    font-family: 'Manrope', system-ui, sans-serif;
    font-weight: 500;
    color: #1f2419;
    background: #fcfdfb;
    padding: 0 16px 0 44px;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
    appearance: none;
}

[dir="rtl"] .field-input {
    padding: 0 44px 0 16px;
}

.field-input:focus {
    border-color: var(--g);
    box-shadow: 0 0 0 4px var(--g-glow);
}

.field-input.is-invalid {
    border-color: #ef4444;
}

.field-input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

#password {
    padding-inline-end: 46px;
}

.field-eye {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9aa18c;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s;
    z-index: 2;
}

[dir="rtl"] .field-eye {
    right: auto;
    left: 6px;
}

.field-eye:hover { color: #374151; }

/* Remember + Forgot */
.form-extras {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 10px;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: #3a4031;
}

.remember-check {
    width: 17px;
    height: 17px;
    accent-color: var(--g);
    cursor: pointer;
}

.forgot-link {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--g-deep);
    text-decoration: none;
}

.forgot-link:hover { text-decoration: underline; }

/* Submit */
.btn-signin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(180deg, #82c247, #6aa537);
    color: #fff;
    font-weight: 800;
    font-size: 15.5px;
    font-family: 'Manrope', system-ui, sans-serif;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(106, 165, 55, 0.32);
    transition: filter .18s, transform .18s;
}

.btn-signin:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.btn-signin:active { transform: translateY(0); }

.btn-signin:disabled {
    opacity: .7;
    transform: none;
    cursor: default;
}

/* Need access */
.need-access {
    text-align: center;
    margin-top: 26px;
    font-size: 13.5px;
    color: #6b7261;
    font-weight: 500;
}

.need-access__link {
    color: var(--g-deep);
    font-weight: 700;
    text-decoration: none;
}

.need-access__link:hover { text-decoration: underline; }

/* Secured footer */
.secured-footer {
    margin-top: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #9aa18c;
    font-size: 11.5px;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   RTL
   ═══════════════════════════════════════════════════════ */
[dir="rtl"] body {
    font-family: 'Tajawal', system-ui, sans-serif;
}

[dir="rtl"] .login-body {
    flex-direction: row-reverse;
}

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

[dir="rtl"] .lang-toggle-btn {
    font-family: 'Tajawal', system-ui, sans-serif;
}

[dir="rtl"] .dest-card {
    align-items: flex-end;
    text-align: end;
}

[dir="rtl"] .field-input {
    font-family: 'Tajawal', system-ui, sans-serif;
}

[dir="rtl"] .btn-signin {
    font-family: 'Tajawal', system-ui, sans-serif;
}

/* ═══════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════ */
@media (max-width: 991px) {
    .login-body,
    [dir="rtl"] .login-body {
        flex-direction: column;
    }

    .brand-panel {
        flex: none;
        padding: 40px 32px;
    }

    .brand-h1   { font-size: 28px; }
    .brand-sub  { font-size: 14px; }
}

@media (max-width: 480px) {
    .brand-panel { padding: 32px 24px; }
    .form-panel  { padding: 32px 24px; }
    .form-title  { font-size: 22px; }
}
