/**
 * Chatvora — login.php & register.php (dark auth UI)
 */

html.sr-auth-html,
html.sr-auth-html body.sr-auth-page {
  background: var(--cv-bg) !important;
  color: var(--cv-text);
}

body.sr-auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow-x: hidden;
  font-family: var(--cv-font);
}

body.sr-auth-page .navbar-area {
  background: transparent !important;
  border-bottom: none !important;
}

body.sr-auth-page .navbar-area .navbar-brand,
body.sr-auth-page .navbar-area .nav-link,
body.sr-auth-page .navbar-area a {
  color: rgba(255, 255, 255, 0.88) !important;
}

/* Main fills viewport below nav; inner wrap centers the card */
.sr-auth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background:
    radial-gradient(1000px 420px at 50% -80px, rgba(99, 102, 241, 0.14), transparent 60%),
    var(--cv-bg);
}

.sr-auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  box-sizing: border-box;
}

/* Login/register shell uses inline styles on .sr-auth-panel; scoped rules below apply to fields only */
.sr-auth-panel {
  background: var(--cv-bg-elevated);
  border: 1px solid var(--cv-border-strong);
  border-radius: 18px;
  padding: 28px 26px;
  width: 100%;
  margin: 0 auto;
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

.sr-auth-panel--login {
  max-width: 440px;
}

.sr-auth-panel--register {
  max-width: 460px;
}

.sr-auth-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.sr-auth-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.42);
  text-align: center;
  margin: 0 0 22px;
}

.sr-auth-field {
  margin-bottom: 1.15rem;
}

body.sr-auth-page .sr-auth-panel label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
}

.sr-auth-label--required::after {
  content: ' *';
  color: #fb7185;
  font-weight: 700;
  font-size: 0.95em;
  vertical-align: baseline;
}

.sr-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sr-auth-input-wrap--password .sr-auth-input {
  padding-right: 3rem !important;
}

body.sr-auth-page .sr-auth-panel input[type='email'],
body.sr-auth-page .sr-auth-panel input[type='password'],
body.sr-auth-page .sr-auth-panel input[type='text'] {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 10px !important;
  color: #fff !important;
  padding: 13px 16px !important;
  font-size: 16px !important;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.4;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}

body.sr-auth-page .sr-auth-panel input:focus {
  outline: none !important;
  border-color: rgba(99, 102, 241, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
  background: rgba(255, 255, 255, 0.07) !important;
}

body.sr-auth-page .sr-auth-panel input::placeholder {
  color: rgba(255, 255, 255, 0.25) !important;
}

body.sr-auth-page .sr-auth-panel input[aria-invalid='true'] {
  border-color: rgba(248, 113, 113, 0.55) !important;
}

.sr-auth-toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.3);
  padding: 4px;
  cursor: pointer;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
}

.sr-auth-toggle-pw:hover {
  color: rgba(255, 255, 255, 0.7);
  background: transparent !important;
}

.sr-auth-field__error {
  margin: 6px 0 0;
  font-size: 12px;
  color: #fca5a5;
  line-height: 1.35;
}

.sr-auth-field__error .sr-auth-inline-link {
  display: inline-block;
  margin-left: 0.35rem;
  color: #818cf8 !important;
  font-weight: 500;
  text-decoration: none !important;
}

.sr-auth-field__error .sr-auth-inline-link:hover {
  text-decoration: underline !important;
}

.sr-auth-row-link {
  display: flex;
  justify-content: flex-end;
  margin: -0.35rem 0 1rem;
}

.sr-auth-forgot {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35) !important;
  text-decoration: none !important;
}

.sr-auth-forgot:hover {
  color: rgba(255, 255, 255, 0.6) !important;
}

.sr-auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sr-auth-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.sr-auth-btn {
  width: 100%;
  padding: 13px;
  background: var(--cv-gradient);
  border: none;
  border-radius: 10px;
  color: #fff !important;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    opacity 0.15s,
    transform 0.15s;
  margin-top: 8px;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none !important;
  display: block;
}

.sr-auth-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  color: #fff !important;
}

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

.sr-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: rgba(255, 255, 255, 0.2);
  font-size: 13px;
}

.sr-divider::before,
.sr-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.sr-auth-footer-link {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  margin-top: 20px;
  margin-bottom: 0;
}

.sr-auth-footer-link a {
  color: #818cf8 !important;
  font-weight: 500;
  text-decoration: none !important;
}

.sr-auth-footer-link a:hover {
  text-decoration: underline !important;
}

.sr-auth-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 1.1rem;
}

.sr-auth-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--cv-muted);
  cursor: pointer;
  margin: 0;
}

.sr-auth-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--cv-accent);
}

.sr-auth-socials {
  display: grid;
  gap: 8px;
}

.sr-auth-social-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.92) !important;
  text-decoration: none !important;
  font-size: 14px;
}

.sr-auth-social-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sr-auth-security-note {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.25);
  margin: 12px 0 0;
}

.sr-auth-check-row {
  margin: 0.55rem 0 0.8rem;
}

.sr-auth-check {
  display: flex;
  align-items: flex-start;
  gap: 0.62rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.5;
}

.sr-auth-check--required > span::after {
  content: ' *';
  color: #fb7185;
  font-weight: 700;
  font-size: 0.95em;
}

.sr-auth-check input[type='checkbox'] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.sr-auth-check a {
  color: #a5b4fc !important;
}

.sr-auth-password-meter {
  margin: 8px 0 0;
}

.sr-auth-password-meter__bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

#sr-reg-password-meter-fill {
  display: block;
  height: 100%;
  width: 0;
  transition: width 0.2s ease;
  background: #ef4444;
}

#sr-reg-password-meter-fill.is-s2,
#sr-reg-password-meter-fill.is-s3 {
  background: #f59e0b;
}

#sr-reg-password-meter-fill.is-s4,
#sr-reg-password-meter-fill.is-s5 {
  background: #22c55e;
}

#sr-reg-password-meter-text {
  margin: 6px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.sr-auth-honeypot {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0;
  pointer-events: none;
}

body.sr-auth-page .go-top {
  display: none !important;
}

body.sr-auth-page .dropdown-menu {
  background: #1a1a2e !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

body.sr-auth-page .dropdown-item {
  color: rgba(255, 255, 255, 0.9) !important;
}

body.sr-auth-page .dropdown-item:hover,
body.sr-auth-page .dropdown-item:focus {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #fff !important;
}

body.sr-auth-page .sr-offcanvas-shell.offcanvas,
body.sr-auth-page .sr-offcanvas-account.offcanvas {
  background: #111118 !important;
}

body.sr-auth-page .offcanvas-header {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

@media (max-width: 479.98px) {
  .sr-auth-panel {
    margin: 20px auto;
    padding: 20px 16px !important;
    border-radius: 16px;
    max-width: 100%;
  }

  .sr-auth-wrap {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .sr-auth-check input[type='checkbox'] {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }

  .sr-auth-title {
    font-size: 21px;
  }

  .sr-auth-subtitle {
    font-size: 13px;
    margin-bottom: 18px;
  }
}
