:root {
  color-scheme: light;
  --ink: #10244b;
  --muted: #526889;
  --blue: #083caa;
  --blue-dark: #06266e;
  --line: rgba(20, 62, 130, 0.22);
  --paper: rgba(250, 252, 255, 0.9);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #dce8ff;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(rgba(242, 247, 255, 0.34), rgba(221, 233, 255, 0.48)),
    url("ce2tech-background.png") center / cover fixed;
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 18px;
  padding: 32px 18px;
}

.login-card {
  width: min(780px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: minmax(220px, 0.82fr) minmax(350px, 1.3fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(16, 45, 106, 0.26);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.identity-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  padding: 46px 38px;
  color: #fff;
  background:
    radial-gradient(circle at 25% 10%, rgba(54, 132, 255, 0.94), transparent 45%),
    linear-gradient(145deg, #06266e, #071c50 72%);
}

.rai-logo {
  width: min(180px, 100%);
  aspect-ratio: 1;
  align-self: center;
  border-radius: 25%;
  object-fit: cover;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
}

.eyebrow {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 500;
  line-height: 0.94;
}

.subtitle {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
}

.login-form {
  padding: 46px 44px 38px;
}

.field-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.field-heading label {
  font-size: 0.95rem;
  font-weight: 700;
}

.field-heading span {
  color: var(--muted);
  font-size: 0.72rem;
}

.serial-control {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 9px;
}

#rai-serial {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: clamp(0.91rem, 2vw, 1.05rem);
  font-weight: 650;
  letter-spacing: 0.08em;
  outline: none;
}

#rai-serial:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(8, 60, 170, 0.13);
}

.new-serial-button {
  display: grid;
  place-items: center;
  border: 1px solid rgba(8, 60, 170, 0.25);
  border-radius: 11px;
  color: var(--blue);
  background: rgba(229, 238, 255, 0.74);
  cursor: pointer;
}

.new-serial-button:hover,
.new-serial-button:focus-visible {
  color: #fff;
  background: var(--blue);
}

button:disabled {
  cursor: wait;
  filter: grayscale(0.45);
  opacity: 0.64;
}

.new-serial-button svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.purpose,
.continuity-note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.purpose {
  margin: 10px 0 24px;
}

.remember-control {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 11px;
  align-items: start;
  cursor: pointer;
}

.remember-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-mark {
  width: 21px;
  height: 21px;
  margin-top: 1px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.8);
}

.remember-control input:focus-visible + .checkbox-mark {
  box-shadow: 0 0 0 3px rgba(8, 60, 170, 0.13);
}

.remember-control input:checked + .checkbox-mark {
  border-color: var(--blue);
  background: var(--blue);
}

.remember-control input:checked + .checkbox-mark::after {
  content: "";
  display: block;
  width: 9px;
  height: 5px;
  margin: 5px 0 0 5px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}

.remember-control strong,
.remember-control small {
  display: block;
}

.remember-control strong {
  font-size: 0.85rem;
}

.remember-control small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.continuity-note {
  margin: 22px 0;
  padding: 11px 13px;
  border-left: 3px solid rgba(8, 60, 170, 0.34);
  background: rgba(225, 235, 255, 0.5);
}

.continue-button {
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 13px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 10px 24px rgba(8, 60, 170, 0.24);
  font-weight: 750;
  cursor: pointer;
}

.continue-button:hover,
.continue-button:focus-visible {
  filter: brightness(1.12);
}

.form-status {
  min-height: 1.2em;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.privacy-note {
  margin: 0;
  color: rgba(16, 36, 75, 0.72);
  font-size: 0.77rem;
  text-align: center;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85);
}

@media (max-width: 680px) {
  .page-shell {
    place-content: start center;
    padding-top: 18px;
  }

  .login-card {
    grid-template-columns: 1fr;
    border-radius: 22px;
  }

  .identity-panel {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    padding: 24px;
  }

  .rai-logo {
    width: 96px;
    flex: 0 0 auto;
  }

  h1 {
    font-size: 3rem;
  }

  .login-form {
    padding: 30px 24px 26px;
  }
}

@media (max-width: 390px) {
  .identity-panel {
    padding: 20px;
  }

  .rai-logo {
    width: 80px;
  }

  #rai-serial {
    letter-spacing: 0.035em;
  }
}
