:root {
  --auth-accent: #075fbd;
  --auth-accent-dark: #06498f;
  --auth-accent-soft: #eaf3ff;
  --auth-gold: #f4c300;
  --auth-text: #162438;
  --auth-muted: #65758a;
  --auth-border: #d9e2ec;
  --auth-danger: #b42335;
  --auth-danger-soft: #fff1f3;
  --auth-shadow: 0 28px 80px rgba(3, 15, 42, 0.34);
}

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

html {
  min-width: 320px;
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--auth-text);
  background: #061331;
  font-family:
    Inter,
    "Segoe UI",
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.auth-body--admin {
  --auth-accent: #123f75;
  --auth-accent-dark: #092b55;
  --auth-accent-soft: #edf4fc;
}

.auth-body--technician {
  --auth-accent: #087da3;
  --auth-accent-dark: #075f7d;
  --auth-accent-soft: #e9f8fc;
}

.auth-page {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  padding: clamp(1.5rem, 5vw, 5rem);
  background-color: #07143d;
  background-image: url("/img/century-login-background.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  isolation: isolate;
}

.auth-page::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    transparent 0%,
    transparent 52%,
    rgba(2, 12, 38, 0.12) 72%,
    rgba(2, 12, 38, 0.42) 100%
  );
  content: "";
  pointer-events: none;
}

.auth-skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 20;
  padding: 0.65rem 1rem;
  color: #fff;
  background: var(--auth-accent);
  border-radius: 0.5rem;
  font-weight: 700;
  text-decoration: none;
}

.auth-skip-link:focus {
  top: 1rem;
}

.auth-card {
  position: relative;
  z-index: 2;
  width: min(100%, 28.5rem);
  padding: clamp(1.65rem, 3vw, 2.35rem);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--auth-shadow);
  backdrop-filter: blur(22px) saturate(125%);
}

.auth-card::before {
  position: absolute;
  top: 0;
  right: 2rem;
  left: 2rem;
  height: 3px;
  background: linear-gradient(90deg, var(--auth-accent), var(--auth-gold));
  border-radius: 0 0 99px 99px;
  content: "";
}

.auth-brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.auth-brand__identity {
  display: flex;
  width: clamp(8.75rem, 32vw, 10.75rem);
  height: auto;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
  overflow: visible;
}

.auth-brand__logo {
  display: block;
  width: 100%;
  height: auto;
  flex: 0 0 100%;
  transform: none;
}

.auth-brand__mark {
  display: grid;
  width: 2.65rem;
  min-width: 2.65rem;
  height: 2.65rem;
  color: var(--auth-accent);
  background: #fff;
  border: 1px solid var(--auth-border);
  border-radius: 0.8rem;
  box-shadow: 0 8px 20px rgba(7, 47, 99, 0.1);
  place-items: center;
  font-size: 1.35rem;
  font-weight: 800;
}

.auth-brand__name {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.15;
}

.auth-brand__name strong {
  color: #0e2d58;
  font-size: 0.92rem;
  letter-spacing: 0.1em;
}

.auth-brand__name small {
  margin-top: 0.25rem;
  color: var(--auth-muted);
  font-size: 0.68rem;
}

.auth-role {
  position: absolute;
  right: 0;
  display: inline-flex;
  padding: 0.4rem 0.65rem;
  color: var(--auth-accent);
  background: var(--auth-accent-soft);
  border: 1px solid color-mix(in srgb, var(--auth-accent) 16%, transparent);
  border-radius: 99px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.auth-heading {
  margin-bottom: 1.5rem;
}

.auth-heading__eyebrow {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--auth-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-heading h1 {
  margin: 0;
  color: var(--auth-text);
  font-size: clamp(1.75rem, 4vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.auth-heading p {
  margin: 0.65rem 0 0;
  color: var(--auth-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.auth-alert {
  display: flex;
  margin-bottom: 1.2rem;
  padding: 0.8rem 0.9rem;
  color: var(--auth-danger);
  background: var(--auth-danger-soft);
  border: 1px solid #ffcdd5;
  border-radius: 0.75rem;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.auth-alert svg {
  width: 1.05rem;
  min-width: 1.05rem;
  margin-top: 0.08rem;
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-field label {
  display: block;
  margin-bottom: 0.45rem;
  color: #34445a;
  font-size: 0.78rem;
  font-weight: 750;
}

.auth-control {
  position: relative;
  display: flex;
  min-height: 3.15rem;
  align-items: center;
}

.auth-control__icon {
  position: absolute;
  left: 0.95rem;
  z-index: 1;
  display: grid;
  width: 1.1rem;
  color: #8090a4;
  pointer-events: none;
  place-items: center;
}

.auth-control__icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.auth-control input {
  width: 100%;
  min-height: 3.15rem;
  padding: 0.75rem 3rem 0.75rem 2.75rem;
  color: var(--auth-text);
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid var(--auth-border);
  border-radius: 0.8rem;
  outline: 0;
  font-size: 0.92rem;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.auth-control input::placeholder {
  color: #9aa7b6;
}

.auth-control input:hover {
  border-color: #bdcad8;
}

.auth-control input:focus {
  background: #fff;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 0.22rem color-mix(in srgb, var(--auth-accent) 15%, transparent);
}

.auth-control:focus-within .auth-control__icon {
  color: var(--auth-accent);
}

.auth-password-toggle {
  position: absolute;
  right: 0.5rem;
  z-index: 2;
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  color: #64748b;
  background: transparent;
  border: 0;
  border-radius: 0.55rem;
  cursor: pointer;
  place-items: center;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  color: var(--auth-accent);
  background: var(--auth-accent-soft);
  outline: 0;
}

.auth-password-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}

.auth-password-toggle .auth-icon--hidden {
  display: none;
}

.auth-password-toggle[aria-pressed="true"] .auth-icon--visible {
  display: none;
}

.auth-password-toggle[aria-pressed="true"] .auth-icon--hidden {
  display: block;
}

.auth-submit {
  position: relative;
  display: inline-flex;
  width: 100%;
  min-height: 3.2rem;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  padding: 0.75rem 1.2rem;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-dark));
  border: 0;
  border-radius: 0.8rem;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--auth-accent) 25%, transparent);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.auth-submit::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.18), transparent 70%);
  content: "";
  transform: translateX(-110%);
  transition: transform 450ms ease;
}

.auth-submit:hover {
  box-shadow: 0 14px 28px color-mix(in srgb, var(--auth-accent) 32%, transparent);
  transform: translateY(-1px);
}

.auth-submit:hover::after {
  transform: translateX(110%);
}

.auth-submit:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--auth-accent) 28%, transparent);
  outline-offset: 3px;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.78;
  transform: none;
}

.auth-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 700ms linear infinite;
}

.auth-help {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  color: var(--auth-muted);
  border-top: 1px solid #e7edf3;
  font-size: 0.76rem;
  line-height: 1.55;
  text-align: center;
}

.auth-help__link {
  color: var(--auth-accent);
  font-weight: 700;
  text-decoration: none;
}

.auth-help__link:hover { text-decoration: underline; }

.auth-alert--success {
  color: #166534;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.auth-security {
  display: flex;
  margin-top: 1rem;
  color: #7b899a;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.68rem;
}

.auth-security svg {
  width: 0.82rem;
  height: 0.82rem;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 880px) {
  .auth-page {
    justify-content: center;
    padding: 1.5rem;
    background-position: 66% center;
    background-size: cover;
  }

  .auth-page::before {
    background: rgba(2, 12, 38, 0.52);
  }
}

@media (max-width: 520px) {
  .auth-page {
    align-items: flex-end;
    padding: 0.8rem;
    background-position: 68% center;
  }

  .auth-card {
    max-height: calc(100svh - 1.6rem);
    padding: 1.4rem;
    overflow-y: auto;
    border-radius: 1.2rem;
  }

  .auth-brand {
    margin-bottom: 1.25rem;
  }

  .auth-role {
    display: none;
  }

  .auth-heading {
    margin-bottom: 1.2rem;
  }

  .auth-heading h1 {
    font-size: 1.7rem;
  }
}

@media (max-height: 660px) and (min-width: 521px) {
  .auth-page {
    align-items: flex-start;
    overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
