/* DeviERP - login / forgot password */
:root {
  color-scheme: light;
  --green-900: #0d3b22;
  --green-800: #14532d;
  --green-700: #1b6b35;
  --green-600: #23843f;
  --green-500: #3a9a4f;
  --orange-600: #f06418;
  --orange-500: #f47b20;
  --orange-400: #f7931e;
  --ink: #111c16;
  --ink-2: #2a3730;
  --muted: #5f6c65;
  --muted-2: #7c8781;
  --line: #dde3df;
  --line-2: #ecefed;
  --bg: #ffffff;
  --radius: 12px;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.lang-ur { --font: "Plus Jakarta Sans", "Noto Naskh Arabic", "Segoe UI", system-ui, sans-serif; }
a { color: inherit; }
input, select, textarea { background-color: #fff; color: var(--ink); }
img { max-width: 100%; display: block; }
.ic { width: 1em; height: 1em; flex: none; }

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.36fr) minmax(420px, 1fr);
  min-height: 100vh;
}

/* ---------------------------------------------------------------- Brand */
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand__mark { width: 70px; height: 70px; object-fit: contain; }
.brand__name { font-weight: 800; color: var(--green-800); font-size: 34px; line-height: 1.05; letter-spacing: -.5px; white-space: nowrap; }
.brand__name span { color: var(--orange-600); }
.brand__tag { margin-top: 4px; font-size: 17.5px; color: var(--ink-2); font-weight: 500; }
.brand--sm .brand__mark { width: 40px; height: 40px; }
.brand--sm .brand__name { font-size: 20px; }

/* ---------------------------------------------------------------- Left hero */
.auth-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 60% at 0% 0%, #ffffff 0%, rgba(255,255,255,0) 60%),
    linear-gradient(180deg, #f6f9f3 0%, #eef5ea 45%, #e7f0e2 100%);
  isolation: isolate;
}
.auth-hero__photo {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 68%;
  background-size: cover;
  background-position: 22% 100%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.28) 14%, rgba(0,0,0,.8) 32%, #000 44%);
          mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.28) 14%, rgba(0,0,0,.8) 32%, #000 44%);
  z-index: -1;
}
.auth-hero__content { position: relative; padding: clamp(32px, 5.2vw, 76px) clamp(24px, 3vw, 44px) 0 clamp(28px, 5.2vw, 76px); max-width: 860px; }
.auth-hero__title {
  margin: clamp(28px, 4.6vh, 54px) 0 18px;
  font-size: clamp(38px, 4.15vw, 62px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -1.6px;
  color: var(--ink);
}
.lang-ur .auth-hero__title { letter-spacing: 0; line-height: 1.5; }
.auth-hero__sub { margin: 0; max-width: 620px; font-size: clamp(17px, 1.6vw, 23.5px); line-height: 1.38; color: #46524b; }

.features { list-style: none; margin: clamp(26px, 4.4vh, 46px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { display: flex; align-items: center; gap: 14px; min-width: 0; }
.feature strong { display: block; font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.feature small { display: block; font-size: 13.4px; line-height: 1.4; color: #4c5852; }
.feature__icon {
  width: 58px; height: 58px; border-radius: 15px; flex: none;
  display: grid; place-items: center; color: #fff; font-size: 28px;
  box-shadow: 0 8px 18px rgba(20, 83, 45, .18), inset 0 1px 0 rgba(255,255,255,.25);
}
.feature__icon--green { background: linear-gradient(145deg, #4fb262, #2a8540); }
.feature__icon--orange { background: linear-gradient(145deg, #ffa340, #f26b18); box-shadow: 0 8px 18px rgba(240,100,24,.25), inset 0 1px 0 rgba(255,255,255,.25); }

/* dashboard preview cards floating over the photo */
.preview { position: absolute; left: 44.5%; top: 59%; width: 400px; pointer-events: none; }
.preview__card, .preview__chart {
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(17, 40, 25, .18);
}
.preview__card { padding: 14px 16px 16px; }
.preview__chart { width: 216px; margin-top: 10px; padding: 12px 14px 14px; }
.preview__head { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.preview__pill { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; background: #fff; }
.preview__up { display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; color: var(--green-600); }
.preview__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.pstat { display: flex; align-items: center; gap: 8px; padding: 10px 8px; border-radius: 9px; background: #f3f6f2; }
.pstat--warm { background: #fff1e4; }
.pstat b { display: block; font-size: 13.5px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.pstat small { display: block; font-size: 8.5px; color: var(--muted); white-space: nowrap; }
.pstat__ic { font-size: 24px; display: grid; place-items: center; }
.pstat__ic--green { color: #3d9a4f; }
.pstat__ic--orange { color: #f47b20; }
.pstat__ic--sage { color: #5aa86a; }
.minibars { display: flex; align-items: flex-end; gap: 8px; height: 70px; margin-top: 12px; padding-left: 22px;
  background: repeating-linear-gradient(180deg, transparent 0 17px, #e8ece9 17px 18px); }
.minibars i { flex: 1; background: linear-gradient(180deg, #43a857, #2b8a41); border-radius: 2px 2px 0 0; }
.minibars i:last-child { background: linear-gradient(180deg, #5cc06f, #36a04c); }

/* ---------------------------------------------------------------- Right panel */
.auth-panel { display: flex; flex-direction: column; min-width: 0; background: #fff; }
.auth-panel__top { display: flex; justify-content: flex-end; align-items: center; padding: 32px 44px 0; }
.auth-panel__top .brand { display: none; margin-inline-end: auto; }
.auth-panel__body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px 44px; }

.lang { position: relative; }
.lang__btn {
  display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px;
  font: 600 16.5px var(--font); color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.lang__btn .ic { font-size: 22px; }
.lang__btn .lang__chev { font-size: 16px; color: var(--muted); transition: transform .15s; }
.lang__btn:hover { border-color: #c4ccc7; }
.lang.is-open .lang__chev { transform: rotate(180deg); }
.lang__menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 100%; z-index: 20;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 16px 36px rgba(16, 40, 24, .14);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: .15s;
}
.lang.is-open .lang__menu { opacity: 1; visibility: visible; transform: none; }
.lang__menu a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 15px; }
.lang__menu a:hover { background: #f2f6f3; }
.lang__menu a.is-active { color: var(--green-700); background: #eaf4ec; }

.auth-card {
  width: 100%; max-width: 530px;
  padding: 46px 46px 40px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(17, 40, 25, .07), 0 2px 6px rgba(17, 40, 25, .03);
}
.auth-card__badge {
  width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--green-700); font-size: 36px;
  box-shadow: 0 10px 26px rgba(17, 40, 25, .12);
}
.auth-card__badge img { width: 58px; height: 58px; object-fit: contain; }
.auth-card__title { margin: 0; text-align: center; font-size: clamp(32px, 3vw, 43px); font-weight: 800; letter-spacing: -1px; color: var(--ink); }
.auth-card__title--sm { font-size: 32px; }
.lang-ur .auth-card__title { letter-spacing: 0; }
.auth-card__sub { margin: 8px 0 34px; text-align: center; font-size: 20.5px; color: var(--muted); }
.auth-card__title--sm + .auth-card__sub { font-size: 16px; line-height: 1.5; margin-bottom: 26px; }

.auth-form { display: grid; gap: 22px; }
.field { display: block; }
.field__label { display: block; margin-bottom: 10px; font-size: 16.5px; font-weight: 700; color: var(--ink-2); }
.field__control { position: relative; display: block; }
.field__icon {
  position: absolute; inset-inline-start: 18px; top: 50%; transform: translateY(-50%);
  font-size: 21px; color: #4b5650; pointer-events: none;
}
.field input {
  width: 100%; height: 54px;
  padding-inline: 58px 16px;
  font: 500 16.5px var(--font); color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input[type="password"], .field input.has-toggle { padding-inline-end: 54px; }
.field input::placeholder { color: var(--muted-2); font-weight: 400; }
.field input:focus { border-color: var(--green-500); box-shadow: 0 0 0 4px rgba(58, 154, 79, .14); }
.field__toggle {
  position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; background: transparent; color: #4b5650; font-size: 21px; cursor: pointer; border-radius: 8px;
}
.field__toggle:hover { background: #f2f5f3; }
.field__toggle .when-shown, .field__toggle[aria-pressed="true"] .when-hidden { display: none; }
.field__toggle[aria-pressed="true"] .when-shown { display: grid; }
.field__toggle .when-hidden { display: grid; }

.auth-form__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: -4px; }
.check { display: inline-flex; align-items: center; gap: 12px; font-size: 16.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
  width: 22px; height: 22px; border: 1.5px solid #b9c2bd; border-radius: 5px;
  display: grid; place-items: center; color: transparent; background: #fff; font-size: 15px; transition: .15s;
}
.check input:checked + .check__box { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.check input:focus-visible + .check__box { box-shadow: 0 0 0 4px rgba(58, 154, 79, .2); }
.link { color: var(--green-700); font-size: 16px; font-weight: 600; text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 6px; }
.link:hover { color: var(--green-800); }

.btn-login {
  margin-top: 8px; width: 100%; height: 62px;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  font: 700 21px var(--font); color: #fff;
  background: linear-gradient(180deg, #f8952a 0%, #f2711c 100%);
  border: 0; border-radius: 10px; cursor: pointer;
  box-shadow: 0 10px 22px rgba(240, 100, 24, .32), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .12s, box-shadow .15s, filter .15s;
}
.btn-login:hover { filter: brightness(1.04); box-shadow: 0 12px 26px rgba(240, 100, 24, .38); }
.btn-login:active { transform: translateY(1px); }
.btn-login:focus-visible { outline: 3px solid rgba(240, 100, 24, .35); outline-offset: 3px; }
.btn-login__arrow { font-size: 24px; }
[dir="rtl"] .btn-login__arrow { transform: scaleX(-1); }
.btn-login.is-busy { pointer-events: none; filter: saturate(.8) brightness(.97); }
.btn-login.is-busy .btn-login__arrow { animation: nudge .8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(4px); } }

.auth-card__secure { display: flex; align-items: center; gap: 16px; margin-top: 42px; }
.auth-card__secure > span { flex: 1; height: 1px; background: var(--line); }
.auth-card__secure p { margin: 0; display: inline-flex; align-items: center; gap: 10px; font-size: 14.6px; color: var(--ink-2); white-space: nowrap; }
.auth-card__secure .ic { font-size: 24px; color: var(--ink-2); }
.auth-card__back { margin: 24px 0 0; text-align: center; }
[dir="rtl"] .auth-card__back .ic { transform: scaleX(-1); }

.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin: -14px 0 22px; border-radius: 10px; font-size: 14.5px; line-height: 1.45; }
.alert .ic { font-size: 19px; margin-top: 1px; }
.alert--error { background: #fdecec; color: #a32020; border: 1px solid #f6caca; }
.alert--ok { background: #e9f6ec; color: #1d6b34; border: 1px solid #c6e6cf; }

.auth-footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  margin: 0 44px; padding: 20px 0 24px; border-top: 1px solid var(--line-2);
  font-size: 11.8px; color: var(--muted);
}
.auth-footer nav { display: flex; gap: 10px; align-items: center; }
.auth-footer a { text-decoration: none; }
.auth-footer a:hover { color: var(--green-700); text-decoration: underline; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1320px) {
  .preview { left: auto; right: 4%; transform: scale(.9); transform-origin: right top; }
}
@media (max-width: 1180px) {
  .auth { grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr); }
  .feature small { display: none; }
  .preview { display: none; }
}
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { min-height: 100vh; background: linear-gradient(180deg, #f3f8f0 0%, #fff 240px); }
  .auth-panel__top { justify-content: space-between; padding: 20px 20px 0; }
  .auth-panel__top .brand { display: flex; }
  .auth-panel__body { padding: 24px 16px; }
  .auth-footer { margin: 0 16px; justify-content: center; text-align: center; }
}
@media (max-width: 520px) {
  .auth-card { padding: 30px 20px 26px; border-radius: 18px; }
  .auth-card__badge { width: 70px; height: 70px; }
  .auth-card__badge img { width: 48px; height: 48px; }
  .auth-card__title { font-size: 30px; }
  .auth-card__sub { font-size: 17px; margin-bottom: 26px; }
  .auth-card__secure p { white-space: normal; text-align: center; font-size: 13.5px; }
  .lang__btn { height: 40px; font-size: 14.5px; padding: 0 12px; }
  .brand--sm .brand__name { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* DeviERP: theme toggle on the login screen */
.auth-panel__top { gap: 10px; }
.theme-btn { width: 46px; justify-content: center; padding: 0; }
.theme-btn span { display: inline-flex; }
.theme-btn__sun { display: none !important; }
html[data-theme="dark"] .theme-btn__moon { display: none !important; }
html[data-theme="dark"] .theme-btn__sun { display: inline-flex !important; color: #ffc861; }
.brand__mark { border-radius: 18px; }
