:root {
  /* Shared with assets/css/brand-theme.css (TeamNexa) */
  --brand: #e31e24;
  --brand-deep: #b11f24;
  --brand-dark: #7a1216;
  --brand-ink: #1a1a1a;
  --brand-red: var(--brand);
  --brand-red-deep: var(--brand-deep);
  --brand-red-dark: var(--brand-dark);
  --ink: #121212;
  --ink-soft: #3a3a3a;
  --muted: #6b6b6b;
  --line: #e6e2e2;
  --surface: #ffffff;
  --surface-soft: #f7f5f5;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --success: #067647;
  --success-bg: #ecfdf3;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(18, 18, 18, 0.14);
  --font-display: "Sora", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --pad: clamp(1.25rem, 4vw, 2.75rem);
  --cut-top: 58%;
  --cut-bottom: 32%;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface-soft);
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100dvh; }

a {
  color: var(--brand-red-deep);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

.login {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(227, 30, 36, 0.06), transparent 40%),
    radial-gradient(circle at 70% 100%, rgba(18, 18, 18, 0.04), transparent 35%),
    var(--surface-soft);
}

.brand {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(120% 80% at 10% 0%, rgba(227, 30, 36, 0.55), transparent 55%),
    radial-gradient(90% 70% at 80% 100%, rgba(122, 18, 22, 0.9), transparent 50%),
    linear-gradient(155deg, #1a1a1a 0%, #2a0c0e 42%, var(--brand-red-dark) 100%);
  clip-path: polygon(0 0, var(--cut-top) 0, var(--cut-bottom) 100%, 0 100%);
  padding: var(--pad);
  padding-right: clamp(4rem, 12vw, 9rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
  pointer-events: none;
}

.brand a,
.brand button { pointer-events: auto; }

.brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 70%);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

.brand::after {
  content: "";
  position: absolute;
  width: min(70vw, 520px);
  height: min(70vw, 520px);
  left: 8%;
  bottom: -22%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transform: rotate(18deg);
  border-radius: 28px;
  box-shadow:
    inset 0 0 0 28px rgba(255, 255, 255, 0.03),
    0 0 0 1px rgba(227, 30, 36, 0.2);
  pointer-events: none;
  z-index: 0;
  animation: float-frame 8s ease-in-out infinite;
}

.slash {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  clip-path: polygon(
    calc(var(--cut-top) - 0.6%) 0,
    calc(var(--cut-top) + 0.35%) 0,
    calc(var(--cut-bottom) + 0.35%) 100%,
    calc(var(--cut-bottom) - 0.6%) 100%
  );
  background: linear-gradient(
    180deg,
    rgba(255, 180, 182, 0.95),
    var(--brand-red) 40%,
    rgba(122, 18, 22, 0.85)
  );
  opacity: 0.9;
  filter: drop-shadow(0 0 10px rgba(227, 30, 36, 0.35));
}

.brand-top,
.brand-copy,
.brand-foot {
  position: relative;
  z-index: 1;
  max-width: min(28rem, 46vw);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  max-width: min(100%, 280px);
  animation: rise 0.7s ease both;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 72px;
  object-fit: contain;
}

.brand-copy {
  margin: 3rem 0;
  animation: rise 0.8s ease 0.12s both;
}

.brand-copy h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.brand-copy h1 span { color: #ffb3b5; }

.brand-copy p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
  max-width: 26ch;
}

.brand-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.62);
  animation: rise 0.8s ease 0.22s both;
}

.brand-foot strong {
  color: #fff;
  font-weight: 600;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-red);
  box-shadow: 0 0 0 4px rgba(227, 30, 36, 0.25);
  flex-shrink: 0;
}

.panel {
  position: relative;
  z-index: 3;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: var(--pad);
  padding-left: clamp(2rem, 18vw, 12rem);
}

.form-shell {
  width: min(100%, 420px);
  position: relative;
  animation: rise 0.75s ease 0.08s both;
}

.form-shell header { margin-bottom: 1.75rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-red-deep);
}

.form-shell h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 1.9rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.form-shell .lede {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.login-form {
  background: var(--surface);
  border: 1px solid rgba(18, 18, 18, 0.06);
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow);
}

.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
  padding: 0.8rem 0.9rem;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.login-alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecdca;
}

.login-alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #abefc6;
}

.field { margin-bottom: 1rem; }

.login-form label.field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.control { position: relative; }

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  height: 48px;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-form input[type="password"] { padding-right: 3rem; }

.login-form input::placeholder { color: #9a9a9a; }

.login-form input:hover { border-color: #d0caca; }

.login-form input:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.16);
}

.toggle-pass {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.toggle-pass:hover,
.toggle-pass:focus-visible {
  color: var(--ink);
  background: var(--surface-soft);
  outline: none;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.25rem 0 1.35rem;
  flex-wrap: wrap;
}

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

.remember input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--brand-red-deep);
  cursor: pointer;
}

.submit {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--brand-red) 0%, var(--brand-red-deep) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(177, 31, 36, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 28px rgba(177, 31, 36, 0.34);
}

.submit:active { transform: translateY(1px); }

.submit:focus-visible {
  outline: 3px solid rgba(227, 30, 36, 0.35);
  outline-offset: 2px;
}

.credit {
  margin-top: 1.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-align: center;
}

.credit p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.credit img {
  display: block;
  height: 30px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

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

@keyframes float-frame {
  0%, 100% { transform: rotate(18deg) translateY(0); }
  50% { transform: rotate(18deg) translateY(-12px); }
}

@media (max-width: 960px) {
  :root {
    --cut-top: 100%;
    --cut-bottom: 100%;
  }

  .login {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .brand {
    position: relative;
    inset: auto;
    clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
    min-height: auto;
    padding: 1.25rem 1.25rem 2.75rem;
    padding-right: 1.25rem;
    pointer-events: auto;
  }

  .slash { display: none; }

  .brand-top,
  .brand-copy,
  .brand-foot { max-width: none; }

  .brand::after {
    width: 220px;
    height: 220px;
    left: auto;
    right: -40px;
    bottom: -80px;
    opacity: 0.55;
  }

  .brand-copy { margin: 1.35rem 0 1rem; }

  .brand-copy h1 {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  .brand-copy p {
    max-width: none;
    font-size: 0.95rem;
  }

  .brand-mark {
    max-width: 200px;
    padding: 0.65rem 0.85rem;
  }

  .brand-mark img { max-height: 52px; }

  .brand-foot { font-size: 0.78rem; }

  .panel {
    min-height: auto;
    justify-content: center;
    align-items: flex-start;
    padding: 0 1.1rem 2rem;
    margin-top: -1.75rem;
  }

  .form-shell header { margin-bottom: 1.2rem; }
}

@media (max-width: 560px) {
  .brand-copy h1 br { display: none; }

  .brand {
    clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%);
  }

  .login-form {
    padding: 1.1rem;
    border-radius: 14px;
  }

  .row-between {
    flex-direction: column;
    align-items: flex-start;
  }

  .login-form input[type="text"],
  .login-form input[type="password"],
  .submit {
    height: 52px;
  }
}

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