/* NAMI CRM sign-in: the form on one side, a preview of the CRM dashboard on the other, in the dashboard's colors. */
:root {
    --nami-primary: #16C15E;
    --nl-primary-deep: color-mix(in srgb, var(--nami-primary) 72%, #04361b);
    --nl-ink: #111827;
    --nl-muted: #6B7280;
    --nl-surface: #ffffff;
    --nl-page: #F8FAF9;
    --nl-field: #F8FAF9;
    --nl-border: #E5EAE8;
    --nl-danger: #b4233c;
    --nl-radius: 14px;
}
:root[data-theme="dark"] {
    --nl-danger: #f87171;
    --nl-ink: #e7edf5;
    --nl-muted: #9aafc8;
    --nl-surface: #1e2d3d;
    --nl-page: #162130;
    --nl-field: #162130;
    --nl-border: #2e4259;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { min-height: 100vh; background: var(--nl-page); color: var(--nl-ink); font-family: 'IBM Plex Sans Arabic', 'Public Sans', sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }

.nl { display: flex; min-height: 100vh; }

/* ── The form ─────────────────────────────────────────── */
.nl__form-side { position: relative; z-index: 2; display: flex; flex: 0 0 min(560px, 44%); flex-direction: column; padding: 28px clamp(24px, 4vw, 56px); background: var(--nl-surface); }
.nl__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nl__logo { max-width: 170px; max-height: 52px; object-fit: contain; }
:root[data-theme="dark"] .nl__logo { filter: brightness(0) invert(1); }
.nl__tools { display: flex; align-items: center; gap: 8px; }
.nl__theme { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--nl-border); border-radius: 50%; background: var(--nl-surface); color: var(--nl-ink); font-size: 19px; cursor: pointer; transition: border-color .15s, color .15s; }
.nl__theme:hover { border-color: var(--nami-primary); color: var(--nami-primary); }
.nl__theme:focus-visible { outline: 3px solid color-mix(in srgb, var(--nami-primary) 45%, transparent); outline-offset: 2px; }
.nl__language { position: relative; }
.nl__language-toggle { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border: 1px solid var(--nl-border); border-radius: 999px; background: var(--nl-surface); color: var(--nl-ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.nl__language-toggle:hover { border-color: var(--nami-primary); }
.nl__language-toggle i { font-size: 17px; }
.nl__language-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 5; display: none; min-width: 170px; padding: 6px; border: 1px solid var(--nl-border); border-radius: 12px; background: var(--nl-surface); box-shadow: 0 16px 40px rgba(17, 24, 39, .14); }
.nl__language-menu.is-open { display: block; }
.nl__language-menu a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--nl-ink); font-size: 14px; text-decoration: none; }
.nl__language-menu a:hover, .nl__language-menu a.is-active { background: color-mix(in srgb, var(--nami-primary) 10%, transparent); color: var(--nl-primary-deep); }
:root[data-theme="dark"] .nl__language-menu a:hover, :root[data-theme="dark"] .nl__language-menu a.is-active { color: var(--nami-primary); }
.nl__language-menu small { color: var(--nl-muted); font-weight: 700; }

.nl__form-wrap { width: 100%; max-width: 420px; margin: auto; padding: 40px 0; }
.nl__badge { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--nami-primary) 11%, transparent); color: var(--nl-primary-deep); font-size: 12.5px; font-weight: 700; }
:root[data-theme="dark"] .nl__badge { color: var(--nami-primary); }
.nl__badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--nami-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--nami-primary) 22%, transparent); }
.nl__form-wrap h1 { margin: 0 0 6px; font-size: clamp(1.7rem, 2.6vw, 2.1rem); font-weight: 700; line-height: 1.3; }
.nl__subtitle { margin: 0 0 28px; color: var(--nl-muted); font-size: 15px; line-height: 1.7; }
.nl__alert { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 11px 14px; border: 1px solid color-mix(in srgb, var(--nl-danger) 30%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--nl-danger) 7%, transparent); color: var(--nl-danger); font-size: 14px; }
.nl__alert i { font-size: 19px; }

.nl__field { margin-bottom: 18px; }
.nl__field label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.nl__input { position: relative; display: flex; flex-wrap: wrap; align-items: flex-start; }
.nl__input > i { position: absolute; top: 16px; inset-inline-start: 15px; z-index: 1; color: var(--nl-muted); font-size: 20px; pointer-events: none; transition: color .15s; }
.nl__input input { width: 100%; height: 52px; padding: 0 46px; border: 1px solid var(--nl-border); border-radius: var(--nl-radius); outline: none; background: var(--nl-field); color: var(--nl-ink); font-size: 15px; text-align: start; transition: border-color .15s, box-shadow .15s, background .15s; }
[dir="rtl"] .nl__input input { text-align: right; }
.nl__input input::placeholder { color: color-mix(in srgb, var(--nl-muted) 75%, transparent); }
.nl__input input:focus { border-color: var(--nami-primary); background: var(--nl-surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--nami-primary) 16%, transparent); }
.nl__input:focus-within > i { color: var(--nami-primary); }
.nl__input input.error, .nl__input input[aria-invalid="true"] { border-color: var(--nl-danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--nl-danger) 12%, transparent); }
.nl__input .form-error, .nl__input .help-block { order: 3; flex: 0 0 100%; margin: 7px 2px 0; padding: 0; color: var(--nl-danger) !important; font-size: 12.5px; line-height: 1.5; }
.nl__input:has(input.error) > i { color: var(--nl-danger); }
/* The browser's saved-password fill keeps the field's own colors (it turned light blue in dark mode). */
.nl__input input:-webkit-autofill, .nl__input input:-webkit-autofill:hover, .nl__input input:-webkit-autofill:focus { -webkit-text-fill-color: var(--nl-ink); caret-color: var(--nl-ink); box-shadow: 0 0 0 1000px var(--nl-field) inset; transition: background-color 9999s; }
.nl__reveal { position: absolute; top: 8px; inset-inline-end: 8px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--nl-muted); font-size: 19px; cursor: pointer; }
.nl__reveal:hover { background: color-mix(in srgb, var(--nami-primary) 10%, transparent); color: var(--nami-primary); }
.nl__reveal:focus-visible, .nl__submit:focus-visible, .nl__language-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--nami-primary) 45%, transparent); outline-offset: 2px; }

.nl__submit { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 54px; margin-top: 26px; border: 0; border-radius: var(--nl-radius); background: linear-gradient(135deg, var(--nl-primary-deep), var(--nami-primary)); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 12px 26px color-mix(in srgb, var(--nami-primary) 32%, transparent); transition: transform .15s, box-shadow .15s, opacity .15s; }
.nl__submit i { font-size: 19px; transition: transform .15s; }
.nl__submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 30px color-mix(in srgb, var(--nami-primary) 38%, transparent); }
.nl__submit:hover:not(:disabled) i { transform: translateX(4px); }
[dir="rtl"] .nl__submit:hover:not(:disabled) i { transform: translateX(-4px); }
.nl__submit:disabled { opacity: .75; cursor: wait; }
.nl__spin { animation: nl-spin 1s linear infinite; }

.nl__footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; color: var(--nl-muted); font-size: 13px; }
.nl__footer a { color: var(--nami-primary); font-weight: 700; text-decoration: none; }

/* ── The CRM preview ──────────────────────────────────── */
.nl__showcase { position: relative; display: flex; flex: 1; align-items: center; justify-content: center; overflow: hidden; padding: clamp(32px, 5vw, 72px); background: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, .16), transparent 42%), linear-gradient(140deg, var(--nl-primary-deep) 0%, var(--nami-primary) 58%, color-mix(in srgb, var(--nami-primary) 80%, #b9f5d0) 100%); color: #fff; }
.nl__showcase::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .18) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000 0%, transparent 85%); }
.nl__rings::before, .nl__rings::after { content: ""; position: absolute; border: 1px solid rgba(255, 255, 255, .14); border-radius: 50%; }
.nl__rings::before { top: -140px; inset-inline-end: -120px; width: 420px; height: 420px; box-shadow: 0 0 0 60px rgba(255, 255, 255, .04); }
.nl__rings::after { bottom: -180px; inset-inline-start: -140px; width: 480px; height: 480px; box-shadow: 0 0 0 44px rgba(255, 255, 255, .04); }
.nl__showcase-inner { position: relative; z-index: 1; width: 100%; max-width: 620px; }

.nl__wordmark { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; padding: 6px 14px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.nl__wordmark b { padding: 1px 7px; border-radius: 6px; background: #fff; color: var(--nl-primary-deep); font-family: 'Public Sans', sans-serif; font-weight: 700; letter-spacing: .06em; }
.nl__intro h2 { max-width: 16ch; margin: 0 0 12px; font-size: clamp(1.8rem, 3.2vw, 2.7rem); font-weight: 700; line-height: 1.25; }
.nl__intro p { max-width: 46ch; margin: 0; color: rgba(255, 255, 255, .86); font-size: 15.5px; line-height: 1.8; }

.nl__preview { display: grid; align-items: start; grid-template-columns: 1.25fr 1fr; grid-template-areas: "kpi target" "pipeline follow" "pipeline ."; gap: 14px; margin: 36px 0 30px; }
.nl__card { padding: 16px 18px; border: 1px solid rgba(255, 255, 255, .55); border-radius: 18px; background: rgba(255, 255, 255, .94); color: #111827; box-shadow: 0 18px 40px rgba(4, 54, 27, .22); animation: nl-float 7s ease-in-out infinite; }
.nl__card:nth-child(2) { animation-delay: -2.2s; }
.nl__card:nth-child(3) { animation-delay: -4.1s; }
.nl__card:nth-child(4) { animation-delay: -5.6s; }
.nl__card-label { display: block; color: #6B7280; font-size: 12.5px; font-weight: 600; }
.nl__card-icon { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; margin-bottom: 8px; border-radius: 11px; background: color-mix(in srgb, var(--nami-primary) 14%, transparent); color: var(--nl-primary-deep); font-size: 20px; }
.nl__card-icon.is-warm { margin: 0; background: rgba(245, 166, 35, .16); color: #c27803; }

.nl__card--kpi { grid-area: kpi; position: relative; overflow: hidden; }
.nl__card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.nl__card-head .nl__card-icon { margin: 0; }
.nl__card--kpi strong { display: block; margin-top: 2px; font-size: 1.55rem; line-height: 1.3; }
.nl__card--kpi strong small { color: #6B7280; font-size: .55em; }
.nl__trend { padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--nami-primary) 14%, transparent); color: var(--nl-primary-deep); font-size: 12px; font-weight: 700; }
.nl__spark { display: block; width: 100%; height: 44px; margin-top: 8px; color: var(--nami-primary); }

.nl__card--pipeline { grid-area: pipeline; }
.nl__card--pipeline ul { display: grid; gap: 13px; margin: 12px 0 0; padding: 0; list-style: none; }
.nl__card--pipeline li { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-size: 13.5px; }
.nl__card--pipeline li > span:first-child { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.nl__card--pipeline li i { color: var(--nl-primary-deep); font-size: 17px; }
.nl__bar { grid-column: 1 / -1; height: 7px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--nami-primary) 12%, transparent); }
.nl__bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--nl-primary-deep), var(--nami-primary)); }
[dir="rtl"] .nl__bar span { background: linear-gradient(270deg, var(--nl-primary-deep), var(--nami-primary)); }

.nl__card--target { grid-area: target; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.nl__ring { --value: 0; display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(closest-side, #fff 76%, transparent 78% 100%), conic-gradient(var(--nami-primary) calc(var(--value) * 1%), color-mix(in srgb, var(--nami-primary) 14%, transparent) 0); }
.nl__ring strong { font-size: 1.3rem; }

.nl__card--follow { grid-area: follow; display: flex; align-items: center; gap: 12px; }
.nl__card--follow b { display: block; font-size: 13.5px; }
.nl__card--follow small { color: #6B7280; font-size: 12.5px; }

.nl__features { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.nl__features li { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; background: rgba(255, 255, 255, .1); font-size: 13px; font-weight: 600; }
.nl__features i { font-size: 16px; }

@keyframes nl-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes nl-spin { to { transform: rotate(360deg); } }

/* ── Smaller screens: laptops keep a narrower preview; tablets and phones show the sign-in only ── */
@media (max-width: 1280px) {
    .nl__form-side { flex-basis: 46%; }
    .nl__preview { grid-template-columns: 1fr 1fr; grid-template-areas: "kpi target" "pipeline follow"; margin: 28px 0 24px; }
    .nl__intro h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
}
/* Short screens: the preview stays whole, the long sentence goes. */
@media (max-height: 860px) and (min-width: 1025px) {
    .nl__intro p { display: none; }
    .nl__intro h2 { margin-bottom: 0; }
    .nl__preview { margin: 26px 0 22px; }
    .nl__card { padding: 14px 16px; }
    .nl__ring { width: 80px; height: 80px; }
}
@media (max-width: 1024px) {
    .nl__showcase { display: none; }
    .nl__form-side { flex: 1 1 100%; min-height: 100vh; min-height: 100dvh; padding: 20px clamp(18px, 6vw, 40px) 22px; }
    .nl__form-wrap { max-width: 440px; padding: 32px 0; }
}
@media (max-width: 480px) {
    .nl__logo { max-width: 130px; max-height: 42px; }
    .nl__language-toggle { padding: 0 10px; }
    .nl__form-wrap { padding: 24px 0; }
    .nl__form-wrap h1 { font-size: 1.6rem; }
    .nl__subtitle { margin-bottom: 22px; font-size: 14px; }
    .nl__input input { height: 50px; font-size: 16px; }
    .nl__submit { height: 52px; margin-top: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    .nl__card, .nl__spin { animation: none; }
    .nl__submit, .nl__submit i { transition: none; }
}
