/* =====================================================================
   SimpleSpa auth pages (login.php, twostep.php) — shared styles
   Page-specific bits stay inline in each page.
   ===================================================================== */

/* ----- Page ----- */
body.login-bg {
  min-height: 100vh;
  min-height: 100dvh; /* real visible height on mobile browsers */
  margin: 0;
  padding: 0;         /* cancel any site-wide body padding (e.g. fixed-navbar offset) */
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  color: #2b2b2b;
  background-color: #eef1f5;
  background-image:
	radial-gradient(circle at 12% 8%, rgba(25, 118, 210, 0.09), transparent 42%),
	radial-gradient(circle at 88% 92%, rgba(25, 118, 210, 0.07), transparent 45%);
  background-attachment: fixed;
  transition: background-color 0.4s ease, color 0.4s ease;
}
/* Centering lives here, not on <body>, so other stylesheets (AdminLTE) can't break it */
.app-container {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-shell {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 38% 62%;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 35, 60, 0.04), 0 12px 40px rgba(15, 35, 60, 0.10);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

/* ----- Brand panel ----- */
.auth-brand {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  padding: 36px 32px 28px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #1e88e5 0%, #1565c0 100%);
}
/* fine dot grid, fading out toward the bottom */
.auth-brand:before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1.5px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 65%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 65%);
  pointer-events: none;
}
/* soft concentric rings, bottom-right */
.auth-brand:after {
  content: "";
  position: absolute;
  width: 340px; height: 340px;
  right: -170px; bottom: -130px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 44px rgba(255, 255, 255, 0.035), 0 0 0 88px rgba(255, 255, 255, 0.025);
  pointer-events: none;
}
.auth-brand > * { position: relative; z-index: 1; }

.auth-brand h1 { margin: 0; }
.auth-logo { display: inline-block; line-height: 0; }
.auth-logo img { width: 170px; height: auto; }

.auth-brand-body { margin-top: auto; padding-top: 40px; }
.auth-brand-body:before {
  content: "";
  display: block;
  width: 28px; height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.6);
  margin-bottom: 16px;
}
.auth-tagline {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 8px;
  color: #ffffff;
}
.auth-sub {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  max-width: 260px;
}

.auth-brand-foot {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 13px;
}
.auth-brand-foot a { color: rgba(255, 255, 255, 0.78); text-decoration: none; }
.auth-brand-foot a:hover, .auth-brand-foot a:focus { color: #ffffff; text-decoration: underline; }

/* ----- Form panel ----- */
.auth-form { position: relative; padding: 40px 44px 30px; color: #2b2b2b; background: transparent; }
.auth-title { font-size: 24px; font-weight: 600; margin: 0 0 4px; color: inherit; }
.auth-status { margin: 0 0 22px; color: #6b7785; font-size: 14px; }

.auth-form .control-label { font-size: 13px; font-weight: 600; color: #4a5562; margin-bottom: 6px; }
.auth-form .form-group { margin-bottom: 16px; }
.auth-form .form-control {
  height: 44px;
  font-size: 16px;
  border-color: #d5dde6;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-form .form-control:focus { border-color: #1976d2; box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15); }
.auth-form .input-group-addon { background: #f7f9fc; border-color: #d5dde6; color: #8592a1; min-width: 44px; }
#togglePw { height: 44px; padding: 10px 14px; border-color: #d5dde6; color: #6b7785; }

.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 18px; }
.auth-row .checkbox { margin: 0; }
.auth-row .checkbox label { font-size: 13px; color: #4a5562; }
.auth-link { font-size: 13px; color: #1976d2; }
.auth-link:hover, .auth-link:focus { color: #0d47a1; }

.btn-signin {
  height: 46px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  background-color: #1976d2;
  border-color: #1976d2;
  box-shadow: 0 2px 6px rgba(25, 118, 210, 0.25);
}
.btn-signin:hover, .btn-signin:focus { background-color: #1565c0; border-color: #1565c0; }

.auth-divider { display: flex; align-items: center; margin: 20px 0 14px; color: #8a96a3; font-size: 12px; }
.auth-divider:before, .auth-divider:after { content: ""; flex: 1; height: 1px; background: #e3e8ee; }
.auth-divider span { padding: 0 12px; }

.auth-sso { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px; }
.auth-sso .btn { height: 42px; line-height: 28px; margin-top: 0; border-radius: 8px; border-color: #d5dde6; font-weight: 500; color: #2b2b2b; background: #ffffff; }
.auth-sso .btn:hover, .auth-sso .btn:focus { background: #f7f9fc; border-color: #c3ceda; }
.auth-sso .btn .fa { font-size: 16px; margin-right: 6px; }

.auth-signup { text-align: center; margin: 20px 0 0; font-size: 14px; color: #6b7785; }

.alert-compact { padding: 10px 12px; margin-bottom: 14px; border-radius: 8px; font-size: 14px; }

/* ----- Theme toggle ----- */
.theme-toggle-btn {
  position: absolute;
  top: 16px; right: 16px;
  width: 34px; height: 34px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  color: #8592a1;
  font-size: 16px;
}
.theme-toggle-btn:hover, .theme-toggle-btn:focus { background: #f1f4f8; color: #1976d2; outline: none; }

.auth-footer { text-align: center; margin-top: 18px; font-size: 11px; }
.auth-footer a { color: #6b7785; text-decoration: none; }

/* ----- Phones / small tablets: brand panel becomes a logo bar ----- */
@media (max-width: 767px) {
  /* top-aligned on phones: no forced full height = no phantom scroll */
  body.login-bg { display: block; min-height: 0; background-attachment: scroll; }
  .app-container { display: block; min-height: 0; padding: 0 0 28px; }
  .auth-shell { grid-template-columns: 1fr; border-radius: 0; box-shadow: none; }
  .auth-brand { padding: 18px 20px; }
  .auth-brand:after { width: 160px; height: 160px; right: -80px; bottom: -110px; box-shadow: 0 0 0 24px rgba(255, 255, 255, 0.035); }
  .auth-logo img { width: 140px; }
  .auth-brand-body, .auth-brand-foot { display: none; }
  .auth-form { padding: 26px 20px 24px; }
  .theme-toggle-btn { top: 22px; right: 14px; }
}

/* ----- Dark: explicit choice ----- */
body.login-bg.theme-dark {
  background-color: #16191e;
  background-image:
	radial-gradient(circle at 12% 8%, rgba(100, 181, 246, 0.07), transparent 42%),
	radial-gradient(circle at 88% 92%, rgba(100, 181, 246, 0.05), transparent 45%);
  color: #f1f1f1;
}
body.login-bg.theme-dark .auth-shell { background: #1f242b; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 44px rgba(0, 0, 0, 0.45); }
body.login-bg.theme-dark .auth-brand { background: linear-gradient(165deg, #1561b8 0%, #0c3c78 100%); }
body.login-bg.theme-dark .auth-form { color: #f7f9fc; }
body.login-bg.theme-dark .auth-status,
body.login-bg.theme-dark .auth-signup,
body.login-bg.theme-dark .auth-divider,
body.login-bg.theme-dark .text-muted { color: #b0bac8; }
body.login-bg.theme-dark .auth-form .control-label,
body.login-bg.theme-dark .auth-row .checkbox label { color: #c5d0de; }
body.login-bg.theme-dark .auth-divider:before,
body.login-bg.theme-dark .auth-divider:after { background: #333c47; }
body.login-bg.theme-dark .auth-form .form-control { background-color: #222831; border-color: #3a4654; color: #f7f9fc; }
body.login-bg.theme-dark .auth-form .form-control:focus { border-color: #64b5f6; box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.2); }
body.login-bg.theme-dark .auth-form .input-group-addon { background-color: #1b222a; border-color: #3a4654; color: #c5d0de; }
body.login-bg.theme-dark .btn-default,
body.login-bg.theme-dark #togglePw,
body.login-bg.theme-dark .auth-sso .btn { background-color: #2a313a; border-color: #3a4654; color: #f7f9fc; }
body.login-bg.theme-dark .auth-sso .btn:hover,
body.login-bg.theme-dark .auth-sso .btn:focus { background-color: #313944; border-color: #4a5868; }
body.login-bg.theme-dark .btn-signin { box-shadow: none; }
body.login-bg.theme-dark .auth-link { color: #64b5f6; }
body.login-bg.theme-dark .alert-compact { background-color: #3b2222; border-color: #7f1e1e; color: #f8d7da; }
body.login-bg.theme-dark .theme-toggle-btn { color: #f7f9fc; }
body.login-bg.theme-dark .theme-toggle-btn:hover,
body.login-bg.theme-dark .theme-toggle-btn:focus { background: #2a313a; }
body.login-bg.theme-dark .well { background-color: #222831; border-color: #3a4654; color: #f7f9fc; }
body.login-bg.theme-dark .auth-footer a { color: #8592a1; }

/* ----- Dark: system preference when no explicit choice (same as explicit dark) ----- */
@media (prefers-color-scheme: dark) {
  body.login-bg:not(.theme-light):not(.theme-dark) {
	background-color: #16191e;
	background-image:
	  radial-gradient(circle at 12% 8%, rgba(100, 181, 246, 0.07), transparent 42%),
	  radial-gradient(circle at 88% 92%, rgba(100, 181, 246, 0.05), transparent 45%);
	color: #f1f1f1;
  }
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-shell { background: #1f242b; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 44px rgba(0, 0, 0, 0.45); }
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-brand { background: linear-gradient(165deg, #1561b8 0%, #0c3c78 100%); }
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-form { color: #f7f9fc; }
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-status,
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-signup,
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-divider,
  body.login-bg:not(.theme-light):not(.theme-dark) .text-muted { color: #b0bac8; }
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-form .control-label,
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-row .checkbox label { color: #c5d0de; }
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-divider:before,
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-divider:after { background: #333c47; }
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-form .form-control { background-color: #222831; border-color: #3a4654; color: #f7f9fc; }
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-form .form-control:focus { border-color: #64b5f6; box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.2); }
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-form .input-group-addon { background-color: #1b222a; border-color: #3a4654; color: #c5d0de; }
  body.login-bg:not(.theme-light):not(.theme-dark) .btn-default,
  body.login-bg:not(.theme-light):not(.theme-dark) #togglePw,
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-sso .btn { background-color: #2a313a; border-color: #3a4654; color: #f7f9fc; }
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-sso .btn:hover,
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-sso .btn:focus { background-color: #313944; border-color: #4a5868; }
  body.login-bg:not(.theme-light):not(.theme-dark) .btn-signin { box-shadow: none; }
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-link { color: #64b5f6; }
  body.login-bg:not(.theme-light):not(.theme-dark) .alert-compact { background-color: #3b2222; border-color: #7f1e1e; color: #f8d7da; }
  body.login-bg:not(.theme-light):not(.theme-dark) .theme-toggle-btn { color: #f7f9fc; }
  body.login-bg:not(.theme-light):not(.theme-dark) .well { background-color: #222831; border-color: #3a4654; color: #f7f9fc; }
  body.login-bg:not(.theme-light):not(.theme-dark) .auth-footer a { color: #8592a1; }
}