:root {
  --kqih-bg-soft: #f8fafc;
  --kqih-surface: #ffffff;
  --kqih-border: #e2e8f0;
  --kqih-text: #0f172a;
  --kqih-muted: #64748b;
  --kqih-primary: #16a34a;
  --kqih-primary-dark: #15803d;
}

body {
  background: var(--kqih-bg-soft);
  color: var(--kqih-text);
}

a,
button,
input,
select,
textarea,
[role="button"] {
  min-height: 44px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.kqih-sidebar-link:focus-visible,
.social-link:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
  box-shadow: none !important;
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.no-kqih-sidebar .kqih-main-content-wrapper,
.no-kqih-sidebar footer {
  margin-left: 0 !important;
  width: 100% !important;
}

.auth-shell {
  min-height: calc(100vh - 90px);
  display: grid;
  place-items: start center;
  padding: 2rem 1rem;
}

.auth-card {
  width: min(100%, 700px);
  background: var(--kqih-surface);
  border: 1px solid var(--kqih-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
}

.auth-hero {
  background: linear-gradient(155deg, #052e16 0%, #166534 45%, #22c55e 100%);
  color: #fff;
  padding: 1.25rem;
}

.auth-hero h2 {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.auth-hero p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.auth-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-list li {
  margin-bottom: 0.4rem;
  font-size: 0.7rem;
}

.auth-list i {
  margin-right: 0.5rem;
}

.auth-form-wrap {
  padding: 1.25rem;
}

.auth-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: var(--kqih-muted);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.auth-form-wrap .form-control,
.auth-form-wrap .form-select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  min-height: 36px;
  font-size: 0.75rem;
}

.auth-form-wrap .form-control:focus,
.auth-form-wrap .form-select:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.15);
}

.auth-submit {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.75rem;
}

.auth-form-wrap .form-label {
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
}

.auth-form-wrap .form-check-label,
.auth-form-wrap .small,
.auth-form-wrap p {
  font-size: 0.75rem;
}

.auth-form-wrap .alert {
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
}

.auth-form-wrap .form-check-input {
  width: 1rem !important;
  height: 1rem !important;
  min-width: 1rem;
  min-height: 1rem;
  border: 2px solid #d1d5db;
  border-radius: 50% !important;
  cursor: pointer;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  vertical-align: middle;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 55%;
  transition: all 0.15s ease-in-out;
  position: relative;
}

.auth-form-wrap .form-check-input:checked {
  background-color: #22c55e;
  border-color: #22c55e;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3E%3C/svg%3E");
}

.auth-form-wrap .form-check-input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.15);
}

.auth-form-wrap .form-check {
  display: inline-flex;
  align-items: center;
  padding-left: 0;
  min-height: auto;
  margin-bottom: 0;
  gap: 0.5rem;
  cursor: pointer;
}

.auth-form-wrap .form-check-label,
.auth-form-wrap .form-check span {
  cursor: pointer;
  user-select: none;
  line-height: 1.2;
  margin-bottom: 0;
  margin-left: 0;
  font-size: 0.75rem;
  color: #374151;
}

.d-flex.justify-content-between.align-items-center {
  align-items: center !important;
  display: flex !important;
}

.d-flex.justify-content-between.align-items-center .form-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
  flex-shrink: 0;
  cursor: pointer;
  padding-left: 0;
}

.d-flex.justify-content-between.align-items-center .form-check-label {
  white-space: nowrap;
  cursor: pointer;
  margin-bottom: 0;
}

.d-flex.justify-content-between.align-items-center .small,
.d-flex.justify-content-between.align-items-center a.small {
  line-height: 1.2;
  font-size: 0.75rem;
  color: #22c55e;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.auth-form-wrap .form-check-label a,
.auth-form-wrap .form-check span a {
  color: #22c55e;
  font-weight: 500;
}

.auth-form-wrap .form-check-label a:hover,
.auth-form-wrap .form-check span a:hover {
  color: #16a34a;
}

.password-toggle-wrapper {
  position: relative;
  display: block;
}

.password-toggle-wrapper .form-control {
  padding-right: 2.5rem;
}

.password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 28px;
  width: 28px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: color 0.2s;
  padding: 0;
  z-index: 10;
}

.password-toggle-btn:hover {
  color: #22c55e;
}

.password-toggle-btn:focus {
  outline: none;
}

@media (max-width: 991.98px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    padding: 1rem;
  }

  .auth-form-wrap {
    padding: 0.875rem;
  }
}
