:root {
  --sentra-bg: #08090a;
  --sentra-surface: rgba(20, 22, 24, 0.92);
  --sentra-surface-2: rgba(10, 11, 12, 0.74);
  --sentra-border: rgba(255, 255, 255, 0.18);
  --sentra-border-soft: rgba(255, 255, 255, 0.10);
  --sentra-text: #f6f7f8;
  --sentra-muted: #a9adb2;
  --sentra-subtle: #777c82;
  --sentra-danger: #ff6b6b;
  --sentra-focus: rgba(255, 255, 255, 0.24);
  --sentra-radius: 28px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  color: var(--sentra-text);
  background-color: var(--sentra-bg);
  background-image: url("../img/sentra/login-circuit-bg.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; }

.login-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 44px 24px;
  overflow: hidden;
}

.login-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.035), transparent 34%),
    linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.28));
}

.login-card {
  position: relative;
  width: min(100%, 604px);
  padding: 34px 52px 42px;
  border: 1px solid var(--sentra-border);
  border-radius: var(--sentra-radius);
  background:
    linear-gradient(145deg, rgba(31, 33, 35, 0.94), rgba(9, 10, 11, 0.96));
  box-shadow:
    0 42px 100px rgba(0, 0, 0, 0.58),
    0 10px 28px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.login-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: calc(var(--sentra-radius) - 1px);
  background: radial-gradient(circle at 50% 0, rgba(255,255,255,.045), transparent 36%);
  pointer-events: none;
}

.environment-pill {
  position: absolute;
  top: 28px;
  right: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: #c8ccd0;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.environment-pill svg { width: 16px; height: 16px; }

.brand-block {
  min-height: 164px;
  display: flex;
  align-items: center;
  padding: 42px 0 27px;
  border-bottom: 1px solid var(--sentra-border-soft);
}

.login-logo {
  display: block;
  width: min(100%, 424px);
  height: auto;
  object-fit: contain;
}

.login-content { padding-top: 28px; }

.login-title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.75rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.login-subtitle {
  margin: 8px 0 24px;
  color: var(--sentra-muted);
  font-size: 0.97rem;
}

.field-group { margin-bottom: 16px; }

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(7, 8, 9, 0.38);
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.input-shell:focus-within {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(8, 9, 10, 0.64);
  box-shadow: 0 0 0 4px var(--sentra-focus);
}

.input-shell.is-invalid { border-color: rgba(255, 107, 107, .72); }
.input-shell.is-invalid:focus-within { box-shadow: 0 0 0 4px rgba(255, 107, 107, .12); }

.input-icon {
  position: absolute;
  left: 17px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #b7bbc0;
  pointer-events: none;
}

.input-icon svg { width: 21px; height: 21px; }

.login-input {
  width: 100%;
  height: 58px;
  padding: 0 52px 0 53px;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font-size: 0.96rem;
  caret-color: #fff;
}

.login-input::placeholder { color: #a6aaaf; opacity: 1; }
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px #111315 inset;
  transition: background-color 9999s ease-out 0s;
}

.password-toggle {
  position: absolute;
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: #b7bbc0;
  background: transparent;
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease;
}
.password-toggle:hover,
.password-toggle:focus-visible { color: #fff; background: rgba(255,255,255,.07); outline: 0; }
.password-toggle svg { width: 21px; height: 21px; }

.login-error {
  margin: 7px 2px 0;
  color: var(--sentra-danger);
  font-size: 0.82rem;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 20px 0 24px;
}

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

.remember-control input {
  width: 19px;
  height: 19px;
  margin: 0;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 5px;
  background-color: rgba(0,0,0,.3);
  accent-color: #fff;
}

.login-link {
  color: #edf0f2;
  font-size: 0.88rem;
  text-decoration: none;
  text-underline-offset: 4px;
}
.login-link:hover { color: #fff; text-decoration: underline; }

.login-alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  font-size: 0.9rem;
  background: rgba(255,255,255,.06);
  color: #eef0f2;
}
.login-alert.alert-danger { border-color: rgba(255,107,107,.3); background: rgba(255,107,107,.10); color: #ffb1b1; }
.login-alert.alert-success { border-color: rgba(102,214,155,.3); background: rgba(102,214,155,.10); color: #b8f0d1; }
.login-alert.alert-warning { border-color: rgba(255,207,102,.3); background: rgba(255,207,102,.10); color: #ffe2a4; }
.login-alert.alert-info { border-color: rgba(116,190,255,.3); background: rgba(116,190,255,.10); color: #bde0ff; }

.login-button {
  position: relative;
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 11px;
  color: #131416;
  background: linear-gradient(180deg, #ffffff 0%, #e7e8ea 100%);
  box-shadow: 0 10px 24px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.75);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.login-button:hover { transform: translateY(-1px); filter: brightness(1.03); box-shadow: 0 14px 30px rgba(0,0,0,.4); }
.login-button:active { transform: translateY(0); }
.login-button:focus-visible { outline: 3px solid rgba(255,255,255,.25); outline-offset: 3px; }

.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 38px;
  padding-top: 24px;
  border-top: 1px solid var(--sentra-border-soft);
  color: #92979d;
  font-size: 0.84rem;
}
.login-footer svg { width: 18px; height: 18px; flex: 0 0 auto; }

@media (max-width: 680px) {
  .login-shell { align-items: start; padding: 18px 14px; }
  .login-card { padding: 28px 22px 30px; border-radius: 22px; }
  .environment-pill { position: static; width: max-content; margin-left: auto; }
  .brand-block { min-height: auto; padding: 24px 0 24px; }
  .login-logo { width: min(100%, 360px); }
  .login-content { padding-top: 24px; }
  .login-options { align-items: flex-start; flex-direction: column; gap: 12px; }
  .login-footer { margin-top: 28px; }
}

@media (max-height: 800px) and (min-width: 681px) {
  .login-shell { padding-block: 20px; }
  .login-card { padding-top: 26px; padding-bottom: 28px; }
  .brand-block { min-height: 134px; padding-top: 32px; padding-bottom: 20px; }
  .login-content { padding-top: 22px; }
  .login-footer { margin-top: 26px; padding-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
