/* ConnectFinance login - Personnel-style split card, CF blue */
:root {
  --cf-blue: #004f82;
  --cf-blue-dark: #003a61;
  --cf-blue-mid: #00639a;
  --cf-blue-light: #d6ebff;
  --cf-blue-muted: #89b4e8;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --field-bg: #f1f5f9;
  --page-bg: #eef2f6;
  --card: #ffffff;
  --shadow: 0 28px 70px rgba(15, 37, 68, 0.16);
  --radius-shell: 28px;
  --radius-control: 12px;
  --font-ui: "Source Sans 3", "Segoe UI", sans-serif;
  --font-display: "Manrope", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 50% at 15% 10%, rgba(0, 79, 130, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 45% at 90% 90%, rgba(0, 58, 97, 0.07), transparent 50%),
    linear-gradient(160deg, #f7f9fb 0%, var(--page-bg) 48%, #e4ebf2 100%);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.viewport {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
}

.login-shell {
  width: min(1080px, 100%);
  min-height: min(640px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(320px, 0.58fr);
  overflow: hidden;
  background: var(--card);
  border-radius: var(--radius-shell);
  box-shadow: var(--shadow);
  animation: cf-shell-in 0.55s ease-out both;
}

@keyframes cf-shell-in {
  from {
    transform: translateY(14px) scale(0.985);
  }
  to {
    transform: none;
  }
}

/* - -  Left visual panel - -  */
.brand-panel {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(145deg, rgba(0, 58, 97, 0.88), rgba(0, 79, 130, 0.78) 55%, rgba(0, 99, 154, 0.72)),
    url("../assets/login-v5/login-hero-finance-ops.png") center / cover no-repeat;
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 45, 75, 0.45) 0%, transparent 48%),
    linear-gradient(90deg, rgba(0, 40, 68, 0.55), rgba(0, 79, 130, 0.35));
  pointer-events: none;
}

.brand-top,
.brand-copy,
.brand-footer {
  position: relative;
  z-index: 1;
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: 0 8px 20px rgba(0, 30, 50, 0.2);
}

.brand-icon {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-wordmark {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.05;
  min-width: 0;
}

.brand-wordmark__primary {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-wordmark__dot {
  color: #7ec8f0;
}

.brand-wordmark__product {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.92;
}

.brand-copy {
  margin: auto 0;
  max-width: 22rem;
  padding-top: 8px;
  animation: cf-copy-in 0.7s 0.12s ease-out both;
}

@keyframes cf-copy-in {
  from {
    transform: translateY(10px);
  }
  to {
    transform: none;
  }
}

.brand-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 2.4vw, 2.15rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.brand-copy .intro {
  margin: 14px 0 0;
  font-size: 1.02rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 400;
}

.brand-footer {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 24px;
}

/* - -  Right form panel - -  */
.form-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 48px 36px;
  background: #fff;
}

.form-panel-top {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

.form-back {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.form-back:hover {
  color: var(--cf-blue);
}

.theme-toggle {
  margin-left: auto;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 13px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.theme-toggle:hover {
  border-color: var(--cf-blue-muted);
  color: var(--cf-blue);
}

.login-card {
  width: min(380px, 100%);
  text-align: left;
  animation: cf-form-in 0.65s 0.08s ease-out both;
}

@keyframes cf-form-in {
  from {
    transform: translateY(8px);
  }
  to {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-shell,
  .brand-copy,
  .login-card {
    animation: none;
  }
}

.card-logo {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  object-fit: contain;
}

.product-name {
  text-align: center;
  color: var(--cf-blue);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  font-weight: 800;
  margin: 0 0 18px;
  text-transform: uppercase;
}

.login-card h2 {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 28px;
  color: var(--ink);
}

.subtext {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  margin: -16px 0 26px;
  line-height: 1.45;
}

form > label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
}

.field {
  height: 50px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  display: flex;
  align-items: center;
  padding: 0 14px;
  margin-bottom: 18px;
  background: var(--field-bg);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field:focus-within {
  border-color: var(--cf-blue);
  box-shadow: 0 0 0 3px rgba(0, 79, 130, 0.14);
  background: #fff;
}

.field svg {
  width: 20px;
  height: 20px;
  color: #94a3b8;
  flex: 0 0 auto;
}

.field input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 12px;
  color: var(--ink);
  min-width: 0;
}

.field input::placeholder {
  color: #94a3b8;
}

.reveal {
  border: 0;
  background: transparent;
  padding: 4px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #94a3b8;
}

.form-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.78rem;
  margin: -6px 0 18px;
  gap: 12px;
}

.form-meta a {
  color: var(--cf-blue);
  text-decoration: none;
  font-weight: 700;
}

.form-meta a:hover {
  text-decoration: underline;
}

.sign-in {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: var(--radius-control);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  background: linear-gradient(90deg, var(--cf-blue), var(--cf-blue-mid));
  box-shadow: 0 12px 24px rgba(0, 79, 130, 0.28);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s, filter 0.2s;
}

.sign-in:hover {
  filter: brightness(1.05);
  box-shadow: 0 14px 28px rgba(0, 79, 130, 0.34);
}

.sign-in:active {
  transform: translateY(1px);
}

.sign-in span {
  margin-left: 8px;
}

.page-footer {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  max-width: 380px;
}

.page-footer a {
  color: var(--cf-blue);
  text-decoration: none;
  font-weight: 700;
}

.page-footer a:hover {
  text-decoration: underline;
}

.page-footer small {
  flex-basis: 100%;
  color: #94a3b8;
}

.cf-alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.cf-alert-error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.cf-alert-success {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.cf-alert a {
  color: inherit;
  font-weight: 700;
}

/* - -  Dark mode - -  */
body.dark {
  background:
    radial-gradient(ellipse 70% 50% at 15% 10%, rgba(0, 99, 154, 0.16), transparent 55%),
    linear-gradient(160deg, #071525 0%, #0a1a2e 50%, #06111f 100%);
}

body.dark .login-shell {
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
}

body.dark .form-panel {
  background: #0d1b2e;
}

body.dark .login-card h2,
body.dark form > label,
body.dark .field input {
  color: #f1f5f9;
}

body.dark .field {
  background: #132338;
  border-color: #243447;
}

body.dark .field:focus-within {
  background: #15263c;
  border-color: var(--cf-blue-muted);
  box-shadow: 0 0 0 3px rgba(137, 180, 232, 0.18);
}

body.dark .theme-toggle {
  background: #132338;
  color: #cbd5e1;
  border-color: #31435e;
}

body.dark .subtext,
body.dark .page-footer {
  color: #94a3b8;
}

body.dark .product-name {
  color: var(--cf-blue-muted);
}

body.dark .sign-in {
  background: linear-gradient(90deg, var(--cf-blue-dark), var(--cf-blue));
}

/* - -  Responsive - -  */
@media (max-width: 900px) {
  .viewport {
    padding: 0;
  }

  .login-shell {
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
    grid-template-columns: 1fr;
    box-shadow: none;
  }

  .brand-panel {
    min-height: 220px;
    padding: 28px 24px;
  }

  .brand-copy h1 {
    font-size: 1.45rem;
  }

  .brand-copy .intro {
    font-size: 0.95rem;
  }

  .form-panel {
    min-height: auto;
    flex: 1;
    padding: 72px 22px 32px;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .brand-panel {
    min-height: 180px;
    padding: 22px 18px;
  }

  .brand-copy {
    margin-top: 18px;
  }

  .card-logo {
    width: 60px;
    height: 60px;
  }

  .login-card h2 {
    font-size: 1.35rem;
  }
}

@media (max-height: 700px) and (min-width: 901px) {
  .login-shell {
    min-height: 560px;
  }

  .brand-panel,
  .form-panel {
    padding-top: 28px;
    padding-bottom: 24px;
  }

  .login-card h2 {
    margin-bottom: 20px;
  }
}
