/* Cloud Management Center unified login surface */

* {
  box-sizing: border-box;
}

:root {
  --login-ink: #122033;
  --login-muted: #647184;
  --login-subtle: #8b97a8;
  --login-line: #dbe3ec;
  --login-panel: #ffffff;
  --login-panel-soft: #f7f9fc;
  --login-field: #fbfdff;
  --login-accent: #2563eb;
  --login-accent-2: #14b8a6;
  --login-navy: #111827;
  --login-danger: #dc2626;
  --login-warning: #a16207;
  --login-success: #047857;
  --login-radius: 8px;
  --login-shadow: 0 24px 80px rgba(17, 24, 39, 0.18);
  --login-shadow-soft: 0 14px 34px rgba(31, 41, 55, 0.12);
  --login-focus: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--login-ink);
  background:
    linear-gradient(120deg, rgba(20, 184, 166, 0.08), transparent 34%),
    linear-gradient(300deg, rgba(37, 99, 235, 0.12), transparent 36%),
    linear-gradient(180deg, #f9fbfd 0%, #eef3f8 100%);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

.login-wrapper {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-shell {
  width: min(100%, 1080px);
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(380px, 460px);
  align-items: stretch;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(219, 227, 236, 0.92);
  border-radius: 0;
  box-shadow: 0 28px 90px rgba(17, 24, 39, 0.14);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.login-brand-panel {
  position: relative;
  display: flex;
  min-height: 620px;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  color: #ffffff;
  background:
    linear-gradient(140deg, rgba(17, 24, 39, 0.97), rgba(18, 32, 51, 0.92)),
    linear-gradient(120deg, rgba(20, 184, 166, 0.24), transparent 48%),
    linear-gradient(300deg, rgba(37, 99, 235, 0.28), transparent 44%);
  isolation: isolate;
}

.login-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.42;
}

.brand-mark {
  width: fit-content;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.08);
}

.brand-mark img {
  display: block;
  width: 166px;
  height: auto;
}

.brand-copy {
  max-width: 440px;
}

.brand-kicker {
  display: inline-flex;
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-copy h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(34px, 4.8vw, 52px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-copy p {
  max-width: 360px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 15px;
  line-height: 1.6;
}

.brand-signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.brand-signal-grid div {
  min-height: 88px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.075);
}

.brand-signal-grid span,
.brand-signal-grid small {
  display: block;
}

.brand-signal-grid span {
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
}

.brand-signal-grid small {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card {
  display: flex;
  min-height: 620px;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
}

.login-card.shake {
  animation: shakeError 0.42s ease;
}

@keyframes shakeError {
  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-6px);
  }

  40%,
  80% {
    transform: translateX(6px);
  }
}

.login-logo {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.login-console-label,
.login-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 0;
  background: rgba(20, 184, 166, 0.08);
  color: #0f766e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-console-label {
  padding: 7px 10px;
}

.login-badge {
  padding: 8px 12px;
}

.login-headline h2 {
  margin: 16px 0 0;
  color: var(--login-ink);
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0;
}

.login-headline p {
  margin: 10px 0 0;
  color: var(--login-muted);
  font-size: 14px;
  line-height: 1.55;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
}

.input-group,
.select-group {
  position: relative;
}

.input-group input,
.select-group select {
  width: 100%;
  min-height: 52px;
  padding: 13px 46px 13px 44px;
  border: 1px solid var(--login-line);
  border-radius: 0;
  outline: 0;
  background: #ffffff;
  color: var(--login-ink);
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input-group input::placeholder {
  color: var(--login-subtle);
  font-weight: 600;
}

.input-group input:hover,
.select-group select:hover {
  border-color: rgba(20, 184, 166, 0.42);
  background: #ffffff;
}

.input-group input:focus,
.select-group select:focus {
  border-color: var(--login-accent);
  background: #ffffff;
  box-shadow: var(--login-focus);
}

.input-icon,
.select-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 2;
  color: var(--login-subtle);
  font-size: 14px;
  transform: translateY(-50%);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: transparent;
  color: var(--login-subtle);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.18s ease, color 0.18s ease;
}

.password-toggle:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--login-accent);
}

.select-group select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23647184' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 16px center;
  background-repeat: no-repeat;
  background-size: 14px;
}

.login-btn {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 0;
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(29, 78, 216, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.login-btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 18px 38px rgba(29, 78, 216, 0.24);
}

.login-btn:active {
  transform: translateY(0);
}

.error-msg,
.security-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.error-msg {
  border: 1px solid rgba(220, 38, 38, 0.18);
  background: rgba(220, 38, 38, 0.08);
  color: var(--login-danger);
}

.security-notice {
  border: 1px solid rgba(161, 98, 7, 0.18);
  background: rgba(245, 158, 11, 0.1);
  color: var(--login-warning);
}

.login-security-note {
  display: block;
  text-align: left;
}

.captcha-group {
  display: grid;
  gap: 10px;
}

.captcha-image-container {
  position: relative;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border: 1px solid var(--login-line);
  border-radius: 0;
  background: #ffffff;
}

.captcha-image {
  border-radius: 0;
  cursor: pointer;
}

.captcha-refresh {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: var(--login-navy);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.captcha-refresh:hover {
  background: var(--login-accent);
  transform: rotate(90deg);
}

.login-captcha-input {
  text-transform: uppercase;
}

.login-static-field {
  display: block;
}

.login-totp-qr,
.login-recovery-codes {
  border: 1px solid var(--login-line);
  border-radius: 0;
  background: #ffffff;
}

.login-totp-qr {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.login-recovery-panel {
  border: 1px solid var(--login-line);
  border-radius: 0;
  background: #ffffff;
  overflow: hidden;
}

.login-recovery-panel summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 14px;
  color: var(--login-ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.login-recovery-panel summary::-webkit-details-marker {
  display: none;
}

.login-recovery-panel summary::after {
  content: "+";
  margin-left: auto;
  color: var(--login-accent);
  font-size: 18px;
  line-height: 1;
}

.login-recovery-panel[open] summary::after {
  content: "-";
}

.login-recovery-panel__body {
  padding: 0 14px 14px;
}

.login-recovery-panel__body p {
  margin: 0 0 12px;
  color: var(--login-muted);
  font-size: 13px;
  line-height: 1.5;
}

.login-recovery-codes {
  padding: 14px 16px;
  font-family: Consolas, "Liberation Mono", monospace;
  line-height: 1.8;
}

.login-recovery-panel--compact .login-recovery-panel__body {
  padding-top: 2px;
}

.login-time-detail,
.login-qr-fallback {
  margin-top: 8px;
  color: var(--login-muted);
  font-size: 0.9rem;
}

.login-qr-fallback {
  text-align: center;
}

.login-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--login-line);
  text-align: center;
}

.login-footer small {
  color: var(--login-subtle);
  font-size: 12px;
  font-weight: 700;
}

.login-legal-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--login-subtle);
  font-size: 12px;
  font-weight: 700;
}

.login-legal-links a {
  color: #456179;
  text-decoration: none;
  transition: color 0.18s ease;
}

.login-legal-links a:hover {
  color: var(--login-accent);
}

.login-btn:focus-visible,
.password-toggle:focus-visible,
.captcha-refresh:focus-visible,
.input-group input:focus-visible,
.select-group select:focus-visible,
.login-legal-links a:focus-visible {
  outline: 2px solid var(--login-accent);
  outline-offset: 2px;
}

@media (max-width: 920px) {
  .login-wrapper {
    align-items: start;
    padding: 20px;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: 300px;
    padding: 28px;
  }

  .login-card {
    min-height: auto;
    padding: 32px 28px;
  }

  .brand-copy h1 {
    font-size: 42px;
  }
}

@media (max-width: 560px) {
  .login-wrapper {
    padding: 0;
  }

  .login-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .login-brand-panel {
    min-height: 220px;
    padding: 24px;
  }

  .brand-signal-grid {
    display: none;
  }

  .brand-mark img {
    width: 146px;
  }

  .brand-copy p {
    margin-top: 12px;
    font-size: 14px;
  }

  .login-card {
    padding: 26px 20px;
  }

  .login-logo {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .login-headline h2 {
    font-size: 24px;
  }
}

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