/* ============================================================
   MCT Auth Pages — mct-auth.css
   Split-panel layout for Login, ForgotPassword, LoginPassword
   ============================================================ */

/* ---- Design Tokens ---------------------------------------- */
:root {
  --auth-brand-bg:   #0F172A;
  --auth-accent:     #2563EB;
  --auth-accent-h:   #1D4ED8;
  --auth-pink:       #DB2777;
  --auth-form-bg:    #F8FAFC;
  --auth-card-bg:    #FFFFFF;
  --auth-text:       #1E293B;
  --auth-muted:      #64748B;
  --auth-border:     #E2E8F0;
  --auth-font:       'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --auth-t:          150ms ease;
}

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--auth-font);
  background: var(--auth-brand-bg);
}

a {
  text-decoration: none;
  color: inherit;
}

/* ============================================================
   SPLIT LAYOUT
   ============================================================ */
.mct-auth-split {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   BRAND PANEL (left)
   ============================================================ */
.mct-auth-brand-panel {
  flex: 0 0 400px;
  background: var(--auth-brand-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
}

/* Decorative ambient glows */
.mct-auth-brand-panel::before {
  content: '';
  position: absolute;
  top: -140px;
  right: -140px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.18) 0%, transparent 68%);
  pointer-events: none;
}

.mct-auth-brand-panel::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(219,39,119,0.14) 0%, transparent 68%);
  pointer-events: none;
}

/* Diagonal grid texture */
.mct-auth-brand-panel .mct-auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.mct-auth-brand-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
  max-width: 300px;
}

/* ---- Logo row -------------------------------------------- */
.mct-auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.75rem;
}

.mct-auth-brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}

.mct-auth-brand-name em {
  font-style: italic;
  opacity: 0.65;
  font-weight: 400;
}

/* ---- Tagline --------------------------------------------- */
.mct-auth-tagline {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -0.025em;
  margin: 0 0 0.75rem;
}

.mct-auth-sub {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.50);
  line-height: 1.65;
  margin: 0 0 2.25rem;
}

/* ---- Feature pills --------------------------------------- */
.mct-auth-pills {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
}

.mct-auth-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0.7rem 0.875rem;
  text-align: left;
}

.mct-auth-pill-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(37,99,235,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #93C5FD;
}

.mct-auth-pill span {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.70);
  line-height: 1.4;
}

/* ============================================================
   FORM PANEL (right)
   ============================================================ */
.mct-auth-form-panel {
  flex: 1;
  background: var(--auth-form-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  min-height: 100vh;
}

.mct-auth-form-wrap {
  width: 100%;
  max-width: 420px;
}

/* Small logo shown at top of form panel (mobile / extra branding) */
.mct-auth-form-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  color: var(--auth-text);
  font-size: 1rem;
  font-weight: 700;
}

.mct-auth-form-logo em {
  font-style: italic;
  color: var(--auth-muted);
  font-weight: 400;
}

/* ============================================================
   PAGE CONTENT CLASSES
   Used by Login.aspx, ForgotPassword.aspx, LoginPassword.aspx
   ============================================================ */
.mct-page-header {
  margin-bottom: 1.75rem;
}

.mct-page-header h1 {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--auth-text);
  letter-spacing: -0.025em;
  margin: 0 0 0.375rem;
}

.mct-page-header p {
  font-size: 0.9rem;
  color: var(--auth-muted);
  margin: 0;
  line-height: 1.5;
}

.mct-form-card-wrapper {}

.mct-form-card {
  background: var(--auth-card-bg);
  border-radius: 14px;
  padding: 2rem;
  box-shadow:
    0 1px 3px rgba(0,0,0,0.06),
    0 8px 32px rgba(0,0,0,0.08);
  border: 1px solid var(--auth-border);
}

.mct-field-group {
  margin-bottom: 1.125rem;
}

.mct-field-group:last-child {
  margin-bottom: 0;
}

.mct-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.375rem;
}

.mct-input,
input.mct-input,
.mct-input[type="text"],
.mct-input[type="password"],
.mct-input[type="email"] {
  display: block;
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-family: var(--auth-font);
  color: var(--auth-text);
  background: #fff;
  transition: border-color var(--auth-t), box-shadow var(--auth-t);
  outline: none;
}

.mct-input:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.mct-btn,
input.mct-btn[type="submit"],
button.mct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.7rem 1.5rem;
  background: var(--auth-accent);
  color: #fff !important;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--auth-font);
  cursor: pointer;
  transition: background var(--auth-t), transform 0.1s;
  text-decoration: none !important;
}

.mct-btn:hover {
  background: var(--auth-accent-h);
}

.mct-btn:active {
  transform: scale(0.99);
}

.mct-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.mct-error {
  display: block;
  font-size: 0.8125rem;
  color: #DC2626;
  margin-top: 0.3rem;
}

.mct-link {
  font-size: 0.875rem;
  color: var(--auth-accent);
  text-decoration: none;
}

.mct-link:hover {
  text-decoration: underline;
  color: var(--auth-accent-h);
}

/* Back to login link row */
.mct-auth-back {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--auth-muted);
}

.mct-auth-back a {
  color: var(--auth-accent);
  font-weight: 500;
}

/* ============================================================
   CHANGEPASSWORD CONTROL
   asp:ChangePassword renders its ChangePasswordTemplate as a
   <table> with no CSS classes. These rules style the raw table
   output so it matches the rest of the mct-auth card design.
   ============================================================ */

/* Reset the outer nested table pair */
.mct-form-card table {
  width: 100%;
  border-collapse: collapse;
  border: none !important;
}

.mct-form-card table td {
  padding: 0.35rem 0.5rem;
  vertical-align: middle;
  border: none !important;
  text-align: left !important;
}

/* Section heading row ("Change Your Password") */
.mct-form-card table td[colspan="2"] {
  padding-bottom: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--auth-text);
  text-align: center !important;
}

/* Label cells */
.mct-form-card table label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
  margin-bottom: 0;
  padding-right: 0.5rem;
}

/* Password inputs */
.mct-form-card table input[type="password"],
.mct-form-card table input[type="text"] {
  display: block;
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-family: var(--auth-font);
  color: var(--auth-text);
  background: #fff;
  transition: border-color var(--auth-t), box-shadow var(--auth-t);
  outline: none;
  min-width: 220px;
  box-sizing: border-box;
}

.mct-form-card table input[type="password"]:focus,
.mct-form-card table input[type="text"]:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Validator error messages (rendered as <span> by ASP.NET) */
.mct-form-card table span[id*="Required"],
.mct-form-card table span[id*="Compare"],
.mct-form-card table span[id*="RegExp"] {
  display: block;
  font-size: 0.8rem;
  color: #DC2626;
  margin-top: 0.2rem;
}

/* Action button row */
.mct-form-card table input[type="submit"],
.mct-form-card table input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  background: var(--auth-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--auth-font);
  cursor: pointer;
  transition: background var(--auth-t);
  margin: 0.25rem 0.25rem 0 0;
  min-width: 80px;
}

.mct-form-card table input[type="submit"]:hover,
.mct-form-card table input[type="button"]:hover {
  background: var(--auth-accent-h);
}

/* Hint text below the card (password requirements) */
.mct-form-card + label.required,
.mct-form-card ~ label.required {
  display: block;
  font-size: 0.8rem;
  color: var(--auth-muted);
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .mct-auth-brand-panel {
    flex: 0 0 320px;
  }
}

@media (max-width: 680px) {
  .mct-auth-split {
    flex-direction: column;
  }

  .mct-auth-brand-panel {
    flex: 0 0 auto;
    padding: 2rem 1.5rem;
  }

  .mct-auth-pills {
    display: none;
  }

  .mct-auth-tagline {
    font-size: 1.2rem;
  }

  .mct-auth-sub {
    display: none;
  }

  .mct-auth-form-panel {
    padding: 2rem 1.25rem;
    justify-content: flex-start;
    min-height: unset;
  }
}

/* ============================================================
   AUTH PORTAL LAYOUT (unified with portal chrome)
   Used by Login / ForgotPassword / ChangePassword / LoginPassword
   when MasterPageAuth wraps content in .mct-auth-portal.
   ============================================================ */
.mct-auth-portal {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Portal-style purple/indigo gradient, matches the rest of the app */
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(219, 39, 119, 0.18), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(37, 99, 235, 0.22), transparent 60%),
    linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #4c1d95 100%);
  color: #E2E8F0;
}

/* Top bar */
.mct-auth-topbar {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(15, 23, 42, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
}

.mct-auth-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.mct-auth-topbar-brand-name {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
}

.mct-auth-topbar-brand-name em {
  font-style: normal;
  color: #f9a8d4;
}

/* Centered card region */
.mct-auth-portal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem;
  outline: none;
}

.mct-login-tagline {
  margin: 0 0 1.25rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  letter-spacing: 0.01em;
}

.mct-login-card {
  width: 100%;
  max-width: 480px;
  background: var(--auth-card-bg, #fff);
  color: var(--auth-text, #1E293B);
  border-radius: 14px;
  box-shadow:
    0 20px 50px rgba(15, 23, 42, 0.45),
    0 4px 12px rgba(15, 23, 42, 0.25);
  padding: 2.25rem 2rem 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mct-login-card .mct-login-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.mct-login-card .mct-login-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  color: var(--auth-text, #1E293B);
}

.mct-login-card .mct-login-body {
  display: block;
}

.mct-auth-back {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--auth-muted, #64748B);
}

.mct-auth-back a {
  color: var(--auth-accent, #2563EB);
  font-weight: 500;
}

.mct-auth-back a:hover {
  color: var(--auth-accent-h, #1D4ED8);
  text-decoration: underline;
}

/* Footer (version bar) */
.mct-auth-versionbar {
  padding: 0.875rem 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(15, 23, 42, 0.25);
}

/* When the auth-portal layout is active, neutralise the dark body bg
   inherited from the legacy split layout — gradient lives on
   .mct-auth-portal itself. */
body:has(.mct-auth-portal) {
  background: transparent;
}

/* Avoid double-card nesting when other auth pages (ForgotPassword,
   ChangePassword, LoginPassword) still wrap their form in
   .mct-form-card / .mct-form-card-wrapper. Inside .mct-login-card
   these become transparent passthroughs. */
.mct-login-card .mct-form-card-wrapper,
.mct-login-card .mct-form-card {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
  margin: 0;
  max-width: none;
  width: 100%;
}

.mct-login-card .mct-page-header {
  text-align: center;
  margin-bottom: 1.25rem;
  padding: 0;
  background: transparent;
}

.mct-login-card .mct-page-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: var(--auth-text, #1E293B);
}

.mct-login-card .mct-page-header p {
  margin: 0;
  color: var(--auth-muted, #64748B);
  font-size: 0.9375rem;
}

.mct-login-card .mct-page-content {
  padding: 0;
  background: transparent;
}

@media (max-width: 600px) {
  .mct-auth-portal-main {
    padding: 1.5rem 1rem;
  }
  .mct-login-card {
    padding: 1.75rem 1.25rem 1.25rem;
    border-radius: 12px;
  }
}
