/**
 * Consortax — client portal login
 */
:root {
  --cx-brand: #0272a7;
  --cx-brand-mid: #015a8a;
  --cx-brand-light: #389fd4;
  --cx-brand-dark: #013953;
  --cx-brand-deep: #002840;
  --cx-accent: #e8950a;
  --cx-navy: #0a1628;
  --cx-text: #3d4f5f;
  --cx-muted: #5c6b7a;
  --cx-border: #d5dee8;
  --cx-surface: #ffffff;
  --cx-input-bg: #f6f9fc;
  --cx-radius: 20px;
  --cx-radius-sm: 12px;
  --cx-shadow: 0 20px 50px rgba(1, 57, 83, 0.1), 0 2px 10px rgba(1, 57, 83, 0.06);
  --cx-font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --cx-focus: rgba(2, 114, 167, 0.18);
}

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

.cx-login-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--cx-font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--cx-text);
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(2, 114, 167, 0.06) 0%, transparent 55%),
    linear-gradient(180deg, #fafbfc 0%, #f2f5f8 100%);
  -webkit-font-smoothing: antialiased;
}

.cx-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 40px;
}

.cx-login__card {
  position: relative;
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--cx-surface);
  border-radius: var(--cx-radius);
  box-shadow: var(--cx-shadow);
  border: 1px solid rgba(213, 222, 232, 0.95);
  overflow: hidden;
}

.cx-login__card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cx-brand-dark) 0%, var(--cx-brand) 100%);
  z-index: 2;
}

@media (min-width: 768px) {
  .cx-login__card {
    grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.05fr);
    min-height: 520px;
  }
}

.cx-login__brand {
  position: relative;
  padding: 40px 36px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(180deg, #0272a7 0%, #015a8a 50%, #013953 100%);
  overflow: hidden;
}

.cx-login__brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 25%, rgba(255, 255, 255, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 88% 80%, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
  pointer-events: none;
}

.cx-login__brand-inner {
  position: relative;
  z-index: 1;
}

.cx-login__logo {
  display: block;
  max-width: 160px;
  height: auto;
  margin-bottom: 28px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.cx-login__brand h2 {
  margin: 0 0 12px;
  font-size: clamp(1.65rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.cx-login__brand p {
  margin: 0 0 24px;
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.92;
  max-width: 28ch;
  line-height: 1.55;
}

.cx-login__brand-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cx-login__brand-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.95;
}

.cx-login__brand-list i {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.75rem;
}

.cx-login__btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  background: transparent;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.cx-login__btn-outline:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: #fff;
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.cx-login__panel {
  padding: 40px 32px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 768px) {
  .cx-login__panel {
    padding: 48px 44px;
  }
}

.cx-login__panel-head {
  margin-bottom: 28px;
}

.cx-login__panel-head h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--cx-brand-dark);
  letter-spacing: -0.02em;
}

.cx-login__panel-head p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--cx-muted);
}

.cx-login__field {
  margin-bottom: 18px;
}

.cx-login__field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cx-navy);
}

.cx-login__field label span {
  color: #ef4444;
  margin-left: 2px;
}

.cx-login__input-wrap {
  position: relative;
}

.cx-login__input-wrap > i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cx-brand);
  opacity: 0.75;
  font-size: 0.95rem;
  pointer-events: none;
}

.cx-login__input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--cx-navy);
  background: var(--cx-input-bg);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.cx-login__input-wrap input::placeholder {
  color: #94a3b8;
}

.cx-login__input-wrap input:focus {
  background: #fff;
  border-color: var(--cx-brand);
  box-shadow: 0 0 0 4px var(--cx-focus);
}

.cx-login__submit {
  width: 100%;
  height: 50px;
  margin-top: 8px;
  border: none;
  border-radius: var(--cx-radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--cx-brand-dark) 0%, var(--cx-brand-mid) 55%, var(--cx-brand) 100%);
  box-shadow: 0 8px 22px rgba(1, 57, 83, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
}

.cx-login__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(1, 57, 83, 0.32);
}

.cx-login__submit:active {
  transform: translateY(0);
}

.cx-login__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--cx-border);
}

.cx-login__links a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cx-brand-dark);
  text-decoration: none;
  transition: color 0.2s;
}

.cx-login__links a:hover {
  color: var(--cx-brand);
  text-decoration: underline;
}

.cx-login__alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
  border-radius: var(--cx-radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
}

.cx-login__alert--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.cx-login__alert--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.cx-login__foot {
  margin-top: 28px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--cx-muted);
}

.cx-login__foot a {
  font-weight: 700;
  color: var(--cx-navy);
  text-decoration: none;
}

.cx-login__foot a:hover {
  color: var(--cx-brand-dark);
}

.cx-login__hint {
  margin: 20px 0 0;
  font-size: 0.875rem;
  color: var(--cx-muted);
}

.cx-login__hint a {
  color: var(--cx-brand-dark);
  font-weight: 600;
  text-decoration: none;
}

.cx-login__hint a:hover {
  color: var(--cx-brand);
  text-decoration: underline;
}

/* —— Register (matches portal login / forgot layout) —— */
.cx-login-page--register .cx-login--wide {
  width: 100%;
  max-width: min(1020px, 92vw);
  margin-left: auto;
  margin-right: auto;
}

.cx-login-page--register .cx-login {
  padding: 28px 16px 36px;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.cx-login__card--register {
  width: 100%;
  max-width: none;
  margin: 0 auto;
}

@media (min-width: 992px) {
  .cx-login__card--register {
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
    align-items: stretch;
  }

  .cx-login__card--register .cx-login__panel {
    padding: 36px 40px 32px;
  }
}

.cx-reg-form .cx-login__field {
  margin-bottom: 0;
}

.cx-reg-section {
  margin-bottom: 26px;
}

.cx-reg-section__title {
  margin: 0 0 14px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cx-brand-mid);
}

.cx-reg-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 18px;
}

@media (min-width: 576px) {
  .cx-reg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .cx-login__card--register .cx-reg-section:first-child .cx-reg-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cx-reg-grid--triple {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .cx-reg-grid--triple {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cx-reg-grid__span2 {
  grid-column: 1 / -1;
}

@media (min-width: 576px) {
  .cx-reg-grid__span2 {
    grid-column: span 2;
  }
}

.cx-login-page--register .cx-login__foot {
  text-align: center;
  width: 100%;
  max-width: min(1020px, 92vw);
  margin-left: auto;
  margin-right: auto;
}

.cx-reg-form .cx-login__input-wrap input,
.cx-reg-form .cx-login__input-wrap select {
  height: 46px;
}

.cx-reg-error {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #dc2626;
}

.cx-reg-captcha-wrap {
  padding: 4px 0;
}

.cx-reg-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--cx-text);
  margin: 0 0 20px;
  padding: 14px 16px;
  background: var(--cx-input-bg);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-sm);
  cursor: pointer;
}

.cx-reg-terms input {
  margin-top: 3px;
  accent-color: var(--cx-brand);
}

.cx-reg-terms a {
  color: var(--cx-brand-dark);
  font-weight: 600;
}

.cx-reg-loader {
  display: none;
  text-align: center;
  margin-bottom: 16px;
}

.cx-reg-loader.is-visible {
  display: block;
}

.cx-reg-loader img {
  max-width: 48px;
}

#register-alert[hidden] {
  display: none !important;
}

.cx-login__input-wrap select {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--cx-navy);
  background: var(--cx-input-bg);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-sm);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cx-login__input-wrap select:focus {
  background-color: #fff;
  border-color: var(--cx-brand);
  box-shadow: 0 0 0 4px var(--cx-focus);
}

.cx-login__input-wrap--plain input {
  padding-left: 16px;
}
