:root {
  color-scheme: light;

  --ink: #f7fbff;
  --muted: #9fb2ca;
  --line: rgba(255, 255, 255, 0.12);
  --page: #eaf2ff;
  --panel: #0d1b31;
  --panel-2: #132743;
  --blue: #64a3ff;
  --blue-strong: #367df0;
  --button-blue: #4f8df7;
  --danger: #ff6b6b;
  --success: #38d39f;
  --warning: #ffca7a;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;

  /*
    Soft ERP background:
    - light blue base
    - radial glow behind login card
    - subtle gradients for premium look
  */
  background:
    radial-gradient(circle at 50% 48%, rgba(103, 153, 236, 0.32), transparent 32%),
    radial-gradient(circle at 12% 18%, rgba(115, 165, 245, 0.25), transparent 28%),
    radial-gradient(circle at 85% 78%, rgba(112, 158, 235, 0.23), transparent 30%),
    linear-gradient(135deg, #f7fbff 0%, #eaf2ff 42%, #dfeafe 100%);
}

/* Main shell */
.auth-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
  isolation: isolate;
  overflow: hidden;
}


.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.34;
  pointer-events: none;

  background-image:
    url("data:image/svg+xml,%3Csvg width='1400' height='800' viewBox='0 0 1400 800' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%236b9eea' opacity='.34'%3E%3Cpath d='M95 575h170l42 45h-255l43-45zm-25 48h340l-28 45h-295z'/%3E%3Cpath d='M145 505h82v60h-82zM160 470h50v40h-50zM237 528h70v37h-70z'/%3E%3Ccircle cx='130' cy='690' r='16'/%3E%3Ccircle cx='330' cy='690' r='16'/%3E%3Cpath d='M1040 500h165l48 52h-310l97-52zm-80 55h360l-35 52h-250z'/%3E%3Cpath d='M1085 430h85v64h-85zM1100 390h52v42h-52zM1180 460h85v35h-85z'/%3E%3Cpath d='M685 170h115v250h-115zM650 420h185v25h-185zM705 130h75v45h-75z'/%3E%3Cpath d='M575 445h330v30h-330zM605 475h270v35h-270z'/%3E%3Cpath d='M610 285l42 42-42 42-42-42zM833 285l42 42-42 42-42-42z'/%3E%3Cpath d='M1175 170l95-28-28 95-25-42-55 24z'/%3E%3Cpath d='M170 155l115 40-45 28-40-13-42 50-30-12 28-58-48-17z'/%3E%3Cpath d='M1035 135h90v62h-90zM1055 105h52v38h-52zM1055 158h12v18h-12zM1088 158h12v18h-12z'/%3E%3Cpath d='M410 560h82v58h-82zM430 520h42v44h-42zM402 618h98v22h-98z'/%3E%3Cpath d='M1230 620h70v70h-70zM1265 570l48 58h-96zM1252 690h28v42h-28z'/%3E%3Cpath d='M470 180h32v32h32v35h-32v32h-35v-32h-32v-35h32v-32z'/%3E%3C/g%3E%3Cg fill='none' stroke='%236b9eea' stroke-width='3' stroke-linecap='round' stroke-dasharray='8 12' opacity='.36'%3E%3Cpath d='M0 105 C190 20 305 92 430 180'/%3E%3Cpath d='M780 95 C970 10 1185 58 1380 150'/%3E%3Cpath d='M820 420 C980 330 1170 330 1400 390'/%3E%3Cpath d='M75 710 C220 660 390 665 540 725'/%3E%3Cpath d='M915 705 C1080 650 1235 655 1385 720'/%3E%3C/g%3E%3Cg fill='%23ffffff' opacity='.78'%3E%3Cellipse cx='155' cy='75' rx='45' ry='15'/%3E%3Cellipse cx='1180' cy='270' rx='48' ry='17'/%3E%3Cellipse cx='300' cy='320' rx='42' ry='15'/%3E%3Cellipse cx='565' cy='615' rx='42' ry='15'/%3E%3C/g%3E%3Cg fill='none' stroke='%236b9eea' stroke-width='4' stroke-linecap='round' opacity='.28'%3E%3Cpath d='M70 730c55-22 105-22 155 0s105 22 160 0 105-22 160 0'/%3E%3Cpath d='M880 745c55-22 105-22 155 0s105 22 160 0 105-22 160 0'/%3E%3C/g%3E%3Cg fill='%23f29b52' opacity='.7'%3E%3Cpath d='M940 55c0-16 13-29 29-29s29 13 29 29c0 26-29 60-29 60s-29-34-29-60zm18 0a11 11 0 1 0 22 0 11 11 0 0 0-22 0z'/%3E%3C/g%3E%3C/svg%3E");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Soft overlay so the icons do not disturb the login form */
.auth-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.1));
}

/* Login card */
.auth-panel {
  width: min(430px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(18, 39, 68, 0.98), rgba(9, 24, 45, 0.98));
  padding: 34px 32px 30px;
  box-shadow:
    0 28px 70px rgba(28, 63, 115, 0.34),
    0 10px 24px rgba(7, 20, 38, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

/* Header */
.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 26px;
  text-align: center;
}

.brand-row img {
  width: 54px;
  height: auto;
  object-fit: contain;
}

.brand-row > div {
  width: 100%;
}

.eyebrow {
  margin: 0 0 12px;
  color: #a8bbd5;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

/* Alerts */
.alerts {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.alert {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #eaf3ff;
  font-size: 0.92rem;
}

.alert--success,
.alert--info {
  border-color: rgba(56, 211, 159, 0.28);
  background: rgba(56, 211, 159, 0.12);
}

.alert--danger,
.alert--warning {
  border-color: rgba(255, 107, 107, 0.3);
  background: rgba(255, 107, 107, 0.12);
}

.alert-link-row {
  margin-top: 8px;
}

.alert a {
  color: #9dc3ff;
  font-weight: 800;
}

/* Form */
.login-form {
  display: grid;
  gap: 17px;
}

label {
  display: grid;
  gap: 8px;
  color: #eef5ff;
  font-size: 0.88rem;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.075);
  color: #ffffff;
  font: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder {
  color: rgba(221, 232, 247, 0.55);
}

input:focus {
  border-color: rgba(100, 163, 255, 0.85);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(79, 141, 247, 0.16);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 76px;
}

.password-toggle {
  position: absolute;
  top: 7px;
  right: 7px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.11);
  color: #cfe0fb;
  font-size: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.password-toggle:hover,
.password-toggle:focus {
  background: rgba(255, 255, 255, 0.17);
  color: #ffffff;
}

/* Main button */
button {
  min-height: 52px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #6fa7ff, #3d79ea);
  color: #ffffff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 28px rgba(42, 109, 226, 0.28);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

button:hover,
button:focus {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(42, 109, 226, 0.36);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.auth-copy {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-link-row {
  margin: 16px 0 0;
  color: #a8bbd5;
  font-size: 0.92rem;
  text-align: right;
}

.auth-link-row a {
  color: #91bdff;
  font-weight: 800;
  text-decoration: none;
}

.auth-link-row a:hover,
.auth-link-row a:focus {
  text-decoration: underline;
}

/* Wider auth pages used by MFA/setup screens */
.auth-panel-wide {
  width: min(720px, 100%);
}

.qr-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.qr-box {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.qr-box svg {
  width: 190px;
  height: auto;
}

.secret-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.secret-box {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.45;
  word-break: break-word;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.method-card {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.method-card h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.18rem;
}

.method-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.method-card .login-form {
  margin-top: auto;
}

.method-status {
  margin-top: auto;
  margin-bottom: 0;
}

.auth-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: auto;
  border-radius: 12px;
  background: linear-gradient(135deg, #6fa7ff, #3d79ea);
  color: #ffffff;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.auth-action-link:hover,
.auth-action-link:focus {
  filter: brightness(1.05);
}

.auth-text-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 16px;
  color: #91bdff;
  font-weight: 800;
  text-decoration: none;
}

.auth-text-link:hover,
.auth-text-link:focus {
  text-decoration: underline;
}

/* Mobile responsiveness */
@media (max-width: 680px) {
  .auth-shell {
    padding: 22px 15px;
  }

  .auth-panel {
    padding: 28px 22px 24px;
    border-radius: 19px;
  }

  .brand-row {
    margin-bottom: 22px;
  }

  h1 {
    font-size: 2.15rem;
  }

  .qr-layout {
    grid-template-columns: 1fr;
  }

  .method-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .auth-panel {
    padding: 24px 18px 22px;
  }

  h1 {
    font-size: 1.9rem;
  }

  input,
  button {
    min-height: 48px;
  }

  .auth-link-row {
    text-align: center;
  }
}