/* FACTUSOFT login — mobile-first, split desktop */

:root {
  --ink: #070b14;
  --panel: #0f1624;
  --panel-elev: #152033;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f7fb;
  --muted: #93a0b5;
  --accent: #1c64f2;
  --accent-2: #45b2ff;
  --danger: #fb7185;
  --ok: #34d399;
  --radius: 18px;
  --touch: 48px;
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body.login-page {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: minmax(180px, 32vh) 1fr;
}

/* —— Hero (photo + brand) —— */
.login-hero {
  position: relative;
  overflow: hidden;
  background-image: var(--login-bg);
  background-size: cover;
  background-position: center 30%;
  isolation: isolate;
}

.login-hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 11, 20, 0.35) 0%, rgba(7, 11, 20, 0.55) 45%, rgba(7, 11, 20, 0.92) 100%),
    linear-gradient(90deg, rgba(28, 100, 242, 0.22), transparent 55%);
  z-index: 1;
}

.login-hero__grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.18;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.login-hero__content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem 1.25rem 1.5rem;
  animation: login-rise 0.7s ease both;
}

.login-hero__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9ec5ff;
}

.login-hero__brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 9vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.login-hero__tagline {
  margin: 0.7rem 0 0;
  max-width: 22rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(244, 247, 251, 0.82);
}

.login-hero__by {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* —— Form panel —— */
.login-panel {
  background: var(--panel);
  border-radius: 24px 24px 0 0;
  margin-top: -1.25rem;
  position: relative;
  z-index: 4;
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.35);
  animation: login-rise 0.75s ease 0.08s both;
}

.login-panel__inner {
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

.login-panel__header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.35rem;
}

.login-panel__logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.35rem;
}

.login-panel__logo--mark {
  padding: 0.55rem;
}

.login-panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-panel__subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.login-alert {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.35);
  color: #fecdd3;
  font-size: 0.88rem;
  line-height: 1.4;
}

.login-form {
  display: grid;
  gap: 0.95rem;
}

.login-field {
  display: grid;
  gap: 0.4rem;
}

.login-field__label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.login-field__control {
  position: relative;
  display: flex;
  align-items: center;
}

.login-field__icon {
  position: absolute;
  left: 0.9rem;
  width: 1.05rem;
  height: 1.05rem;
  color: #7f90a8;
  pointer-events: none;
}

.login-field input {
  width: 100%;
  min-height: var(--touch);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0a101b;
  color: var(--text);
  font: 500 16px/1.3 var(--font-body);
  padding: 0.75rem 2.75rem 0.75rem 2.65rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-field input::placeholder {
  color: #6b7a90;
}

.login-field input:focus {
  border-color: rgba(28, 100, 242, 0.75);
  box-shadow: 0 0 0 4px rgba(28, 100, 242, 0.2);
  background: #0c1422;
}

.login-field__toggle {
  position: absolute;
  right: 0.35rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8ea0b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.login-field__toggle:hover,
.login-field__toggle:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.login-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.login-remember input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.login-forgot {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-2);
  text-decoration: none;
}

.login-forgot:hover,
.login-forgot:focus-visible {
  text-decoration: underline;
}

.login-submit {
  margin-top: 0.35rem;
  min-height: 52px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font: 700 1rem/1 var(--font-body);
  color: #fff;
  background: linear-gradient(135deg, #1c64f2 0%, #0092ff 100%);
  box-shadow: 0 12px 28px rgba(28, 100, 242, 0.35);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.login-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 16px 32px rgba(28, 100, 242, 0.42);
}

.login-submit:active {
  transform: translateY(1px) scale(0.99);
}

.login-panel__footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: #66758c;
}

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

/* —— Tablet —— */
@media (min-width: 720px) {
  .login-shell {
    grid-template-rows: minmax(240px, 36vh) 1fr;
  }

  .login-hero__content {
    padding: 2rem 2.5rem 2.25rem;
  }

  .login-panel {
    border-radius: 28px 28px 0 0;
  }

  .login-panel__inner {
    padding: 2rem 1.75rem 2.25rem;
  }
}

/* —— Desktop split —— */
@media (min-width: 992px) {
  .login-shell {
    grid-template-columns: 1.15fr 0.85fr;
    grid-template-rows: none;
    min-height: 100dvh;
  }

  .login-hero {
    min-height: 100dvh;
    background-position: center;
  }

  .login-hero__veil {
    background:
      linear-gradient(105deg, rgba(7, 11, 20, 0.55) 0%, rgba(7, 11, 20, 0.25) 45%, rgba(7, 11, 20, 0.72) 100%),
      linear-gradient(180deg, transparent 40%, rgba(7, 11, 20, 0.75));
  }

  .login-hero__content {
    justify-content: center;
    padding: 3.5rem clamp(2rem, 5vw, 4.5rem);
    max-width: 38rem;
    animation: login-rise 0.85s ease both;
  }

  .login-hero__brand {
    font-size: clamp(3.4rem, 5.5vw, 5.2rem);
  }

  .login-hero__tagline {
    font-size: 1.1rem;
    max-width: 26rem;
  }

  .login-panel {
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    display: grid;
    place-items: center;
    background:
      radial-gradient(ellipse at top right, rgba(28, 100, 242, 0.14), transparent 45%),
      var(--panel);
  }

  .login-panel__inner {
    width: min(100%, 420px);
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 22, 36, 0.72);
    backdrop-filter: blur(10px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  }
}

@media (min-width: 1280px) {
  .login-panel__inner {
    width: 440px;
    padding: 2.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-hero__content,
  .login-panel {
    animation: none;
  }
}
