/* Finovas Global - premium login screen with hero art + glass */

.login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  background: var(--bg);
  font-family: 'Inter', 'Noto Sans Thai', sans-serif;
  overflow-x: hidden;
}

/* ── Left: Hero ────────────────────────────────────────────────── */
.login-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg,
    #0A1448 0%, #0E1B5A 30%, #14267A 65%, #1A2C8C 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(28px, 4vw, 56px);
  min-width: 0;
}
.login-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%,
      rgba(61, 79, 245, .38), transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%,
      rgba(255, 120, 73, .22), transparent 60%);
  pointer-events: none;
}

.login-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center,
    rgba(0, 0, 0, .7), transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center,
    rgba(0, 0, 0, .7), transparent 75%);
  pointer-events: none;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .65;
  animation: orbFloat 14s ease-in-out infinite;
  pointer-events: none;
}
.login-orb-1 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, #5C73FF, transparent 70%);
  top: -80px; left: -80px;
}
.login-orb-2 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, #FF7849, transparent 70%);
  bottom: -60px; right: -80px;
  opacity: .42;
  animation-delay: -5s;
}
.login-orb-3 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, #3FE0A8, transparent 70%);
  top: 40%; right: 18%;
  opacity: .32;
  animation-delay: -9s;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.05); }
  66% { transform: translate(-15px, 20px) scale(.95); }
}

.login-hero-inner {
  position: relative; z-index: 1;
  max-width: min(520px, 100%); width: 100%;
  display: flex; flex-direction: column; gap: 24px;
  animation: heroIn .6s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-brand { display: flex; align-items: center; gap: 14px; }
.login-mark {
  width: 44px; height: 44px; border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .35),
              0 0 0 1px rgba(255, 255, 255, .15);
}
.login-brand-text { display: flex; flex-direction: column; }
.login-brand-text b {
  font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: #fff;
}
.login-brand-text span {
  font-size: 12px; color: rgba(255, 255, 255, .65);
  letter-spacing: .06em; text-transform: uppercase; font-weight: 600;
}

.login-hero-title {
  font-size: clamp(24px, 2.6vw, 38px);
  font-weight: 800; letter-spacing: -.02em; line-height: 1.18;
  color: #fff; margin: 0;
  text-wrap: balance;
  /* Thai text - keep multi-character words intact so they don't break
     awkwardly in the middle of a syllable when the column narrows. */
  word-break: keep-all;
  overflow-wrap: break-word;
}
.login-hero-sub {
  font-size: clamp(13px, 1.1vw, 15px);
  color: rgba(255, 255, 255, .78);
  max-width: 100%; line-height: 1.55; margin: 0;
  text-wrap: pretty;
  word-break: keep-all;
}

.login-hero-art {
  position: relative; margin: 4px 0;
  border-radius: 22px; overflow: hidden;
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: artIn .8s cubic-bezier(.16, 1, .3, 1) .2s both;
}
.login-hero-art img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 4 / 5; object-fit: cover; max-height: 340px;
}
@keyframes artIn {
  from { opacity: 0; transform: translateY(30px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-features {
  display: flex; flex-direction: column; gap: 10px;
  margin: 0; padding: 0; list-style: none;
}
.login-features li {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .07);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: featIn .55s cubic-bezier(.16, 1, .3, 1) both;
  transition: .22s ease;
  min-width: 0;
}
.login-feature-body b,
.login-feature-body span {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.login-features li:hover {
  background: rgba(255, 255, 255, .12);
  transform: translateX(3px);
}
@keyframes featIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.login-feature-ic {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  flex-shrink: 0;
}
.login-feature-body { display: flex; flex-direction: column; gap: 1px;
  min-width: 0; }
.login-feature-body b {
  font-size: 14px; font-weight: 700; color: #fff;
  letter-spacing: -.005em;
}
.login-feature-body span {
  font-size: 12px; color: rgba(255, 255, 255, .65); line-height: 1.5;
}

.login-trust {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: rgba(255, 255, 255, .65);
  font-weight: 600; margin-top: 4px;
}
.login-trust-dot {
  width: 8px; height: 8px; background: #3FE0A8; border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(63, 224, 168, .28);
  animation: trustPulse 2s ease-in-out infinite;
}
@keyframes trustPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(63, 224, 168, .28); }
  50% { box-shadow: 0 0 0 8px rgba(63, 224, 168, .12); }
}

/* ── Right: Form ───────────────────────────────────────────────── */
.login-form {
  position: relative;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 48px 48px 80px;
  /* Soft indigo wash so the white card has visible separation */
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%,
      color-mix(in srgb, var(--brand) 12%, var(--bg)),
      var(--bg) 70%),
    var(--bg);
  min-height: 100vh;
}
.login-form::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 15% 85%,
      color-mix(in srgb, var(--accent) 18%, transparent), transparent 35%),
    radial-gradient(circle at 90% 15%,
      color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 35%);
  pointer-events: none;
  opacity: .9;
}

.login-controls {
  position: absolute;
  top: 20px; right: 20px;
  display: flex; gap: 8px;
  z-index: 10;
}
.login-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text); cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 12.5px;
  transition: .14s ease;
}
.login-pill:hover {
  background: var(--surface-2);
  border-color: var(--brand);
  transform: translateY(-1px);
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  /* Deep navy-tinted shadow so the white card visibly lifts off the wash */
  box-shadow:
    0 30px 60px -15px rgba(14, 27, 90, .22),
    0 12px 24px -8px rgba(14, 27, 90, .12),
    0 0 0 1px rgba(61, 79, 245, .04);
  animation: cardIn .55s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-card-deco {
  position: absolute;
  top: -2px; left: 20%; right: 20%; height: 4px;
  background: linear-gradient(90deg,
    transparent, var(--brand), var(--brand-2), transparent);
  border-radius: 0 0 4px 4px;
  filter: blur(.5px);
}

.login-welcome {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .1em;
}
.login-title {
  font-size: 26px; font-weight: 800;
  color: var(--text); margin: 12px 0 6px;
  letter-spacing: -.015em;
}
.login-sub {
  font-size: 13.5px; color: var(--text-muted);
  margin: 0 0 24px; line-height: 1.5;
}

.login-fields { display: flex; flex-direction: column; gap: 14px; }
.field-row { display: flex; flex-direction: column; gap: 6px; }
.field-row label {
  font-size: 12px; font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .03em; text-transform: uppercase;
}
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input-ic {
  position: absolute; left: 12px;
  color: var(--text-soft);
  pointer-events: none; display: flex;
  transition: color .14s;
}
.input-wrap .input {
  width: 100%; height: 46px;
  padding-left: 40px; font-size: 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  color: var(--text);
  font-weight: 500;
  transition: border-color .14s, box-shadow .14s, background .14s;
}
.input-wrap .input::placeholder {
  color: var(--text-soft);
  opacity: 1;
}
.input-wrap .input:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border-strong));
}
.input-wrap .input:focus {
  outline: 0;
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}
.input-wrap:focus-within .input-ic {
  color: var(--brand);
}

.login-remember {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; margin: 4px 0;
}
.login-remember label {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; color: var(--text-muted); font-weight: 600;
}
.login-remember input[type="checkbox"] {
  accent-color: var(--brand);
}
.login-forgot {
  color: var(--brand); font-size: 12.5px;
  font-weight: 600; text-decoration: none;
}
.login-forgot:hover { text-decoration: underline; }

.login-submit {
  width: 100%; height: 48px;
  font-size: 15px; font-weight: 700;
  margin-top: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: 0; border-radius: 12px; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 24px -6px
    color-mix(in srgb, var(--brand) 50%, transparent);
  transition: .18s ease; cursor: pointer;
}
.login-submit .arrow {
  transition: transform .25s ease; font-weight: 400;
}
.login-submit:hover .arrow { transform: translateX(4px); }
.login-submit:hover {
  box-shadow: 0 12px 30px -6px
    color-mix(in srgb, var(--brand) 60%, transparent);
  transform: translateY(-1px);
}
.login-submit:active { transform: translateY(0); }
.login-submit:disabled { opacity: .8; cursor: wait; }

.login-divider {
  position: relative; text-align: center;
  margin: 22px 0 14px;
}
.login-divider::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: var(--border);
}
.login-divider span {
  position: relative;
  background: var(--surface);
  color: var(--text-soft);
  padding: 0 14px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
}

.login-demo-hint {
  text-align: left;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--brand) 5%, var(--surface-2));
  border: 1px dashed
    color-mix(in srgb, var(--brand) 35%, var(--border));
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.login-demo-label {
  font-size: 11px; font-weight: 700;
  color: var(--brand);
  text-transform: uppercase; letter-spacing: .08em;
  text-align: center;
  margin-bottom: 2px;
}
.login-demo-row {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  padding: 7px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .14s, transform .12s, box-shadow .14s;
  font-size: 12px;
}
.login-demo-row:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 28%, transparent);
}
.login-demo-row:active { transform: translateY(0); }
.login-demo-role {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  flex-shrink: 0;
}
.login-demo-row .role-user {
  background: color-mix(in srgb, var(--brand) 14%, var(--surface));
  color: var(--brand);
}
.login-demo-row .role-admin {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent);
}
.login-demo-sep { color: var(--text-soft); }
.login-demo-hint kbd {
  display: inline-block;
  padding: 2px 7px; border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font: 600 11.5px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text);
}

.login-footer {
  position: absolute;
  bottom: 20px; left: 0; right: 0;
  text-align: center;
  font-size: 11.5px; color: var(--text-soft);
}

/* ── Responsive ────────────────────────────────────────────────── */
/* Mid-large (≤ 1280px): shave the hero column down, keep art visible */
@media (max-width: 1280px) {
  .login-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .login-hero { padding: 40px; }
  .login-hero-inner { gap: 20px; max-width: 460px; }
  .login-hero-art img { max-height: 300px; }
  .login-features li { padding: 11px 13px; }
}

/* Tablet (≤ 1024px): drop the hero art block, keep the rest */
@media (max-width: 1024px) {
  .login-hero { padding: 32px; }
  .login-hero-art { display: none; }
  .login-hero-inner { gap: 18px; }
  .login-features li { padding: 10px 13px; }
}

/* Tall-content fallback (short viewports) */
@media (max-height: 820px) {
  .login-form {
    justify-content: flex-start;
    padding-top: 64px;
    padding-bottom: 96px;
  }
  .login-hero {
    align-items: flex-start;
    padding-top: 48px;
    padding-bottom: 48px;
  }
  .login-hero-inner { gap: 18px; }
  .login-hero-art img { max-height: 240px; }
  .login-features li { padding: 10px 13px; }
}

/* Mobile (≤ 880px): hero collapses, form takes full width */
@media (max-width: 880px) {
  .login-shell { grid-template-columns: 1fr; min-height: 100vh; }
  .login-hero { display: none; }
  .login-form { padding: 32px 20px 64px; min-height: 100vh; }
  .login-card { padding: 32px 24px; max-width: 100%; }
  .login-footer { position: static; margin-top: 24px; }
}

[data-theme="dark"] .login-card {
  background: var(--surface);
  box-shadow: 0 24px 80px -30px rgba(0, 0, 0, .6);
}
[data-theme="dark"] .login-divider span {
  background: var(--surface);
}
