/* ============================================
   BRN Korda Sulsel — Auth (Login)
   ============================================ */

.auth-body {
  min-height: 100dvh;
}

.auth-page {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-page__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-page__gradient {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero), var(--color-bg);
}

.auth-page__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: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black, transparent);
}

.auth-page__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}

.auth-page__orb--1 {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -80px;
  background: rgba(59, 130, 246, 0.35);
}

.auth-page__orb--2 {
  width: 360px;
  height: 360px;
  bottom: -100px;
  left: -60px;
  background: rgba(245, 158, 11, 0.2);
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(1040px, 100%);
  min-height: min(640px, calc(100dvh - 3rem));
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  background: rgba(18, 26, 40, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* ---- Brand panel ---- */
.auth-brand {
  display: flex;
  flex-direction: column;
  padding: 2.5rem;
  background: linear-gradient(165deg, rgba(59, 130, 246, 0.12) 0%, transparent 55%),
    rgba(7, 11, 18, 0.6);
  border-right: 1px solid var(--color-border);
}

.auth-brand__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 2.5rem;
}

.auth-brand__logo .logo__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  border-radius: var(--radius-sm);
  color: #0a0a0a;
}

.auth-brand__logo .logo__icon svg {
  width: 22px;
  height: 22px;
}

.auth-brand__content h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1rem;
}

.auth-brand__content > p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  max-width: 36ch;
  margin-bottom: 2rem;
}

.auth-brand__features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-brand__features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.auth-brand__features svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-primary);
}

.auth-brand__back {
  margin-top: auto;
  padding-top: 2rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  transition: color var(--transition);
}

.auth-brand__back:hover {
  color: var(--color-primary);
}

/* ---- Login card ---- */
.auth-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
}

.auth-card__inner {
  width: min(400px, 100%);
}

.auth-card__header {
  margin-bottom: 1.75rem;
}

.auth-card__header h2 {
  font-size: 1.65rem;
  margin-bottom: 0.5rem;
}

.auth-card__header p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ---- Alerts ---- */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.auth-alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.auth-alert--error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.auth-alert--success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

/* ---- Form ---- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  color-scheme: dark;
}

.auth-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--color-text-muted);
}

.auth-field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.auth-field__label-row label {
  margin-bottom: 0;
}

.auth-field__wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-field__icon {
  position: absolute;
  left: 0.875rem;
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  pointer-events: none;
  z-index: 1;
}

.auth-field input {
  width: 100%;
  height: 48px;
  padding: 0 1rem 0 2.65rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--color-text);
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: none;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.auth-field--password input {
  padding-right: 2.85rem;
}

.auth-field input::placeholder {
  color: rgba(139, 155, 181, 0.55);
}

.auth-field input:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.auth-field input:focus {
  outline: none;
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
  background-color: rgba(13, 20, 32, 0.95);
}

/* Override browser autofill (fixes white/password field flash) */
.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover,
.auth-field input:-webkit-autofill:focus,
.auth-field input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--color-text) !important;
  caret-color: var(--color-text);
  border: 1px solid var(--color-border) !important;
  box-shadow: 0 0 0 1000px var(--color-bg-alt) inset !important;
  transition: background-color 99999s ease-out 0s;
}

.auth-field input:autofill {
  box-shadow: 0 0 0 1000px var(--color-bg-alt) inset !important;
  -webkit-text-fill-color: var(--color-text) !important;
}

.auth-field--error input {
  border-color: rgba(239, 68, 68, 0.55);
}

.auth-field--error input:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.auth-field__error {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--color-danger);
}

.auth-field__toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  z-index: 1;
}

.auth-field__toggle:hover {
  color: var(--color-primary-light);
  background: rgba(255, 255, 255, 0.06);
}

.auth-field__toggle:focus-visible {
  outline: 2px solid rgba(245, 158, 11, 0.5);
  outline-offset: 2px;
}

.auth-field__toggle-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.auth-field__toggle-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Password disembunyikan → ikon mata silang */
.auth-field__toggle-icon--hide {
  opacity: 1;
}

.auth-field__toggle-icon--show {
  opacity: 0;
}

/* Password terlihat → ikon mata buka */
.auth-field__toggle.is-visible .auth-field__toggle-icon--hide {
  opacity: 0;
}

.auth-field__toggle.is-visible .auth-field__toggle-icon--show {
  opacity: 1;
}

.auth-field__toggle.is-visible .auth-field__toggle-icon--show svg {
  color: var(--color-primary-light);
}

.auth-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-primary-light);
  white-space: nowrap;
  transition: color var(--transition);
}

.auth-link--sm {
  font-size: 0.75rem;
}

.auth-link:hover {
  color: var(--color-primary);
}

.auth-form__submit {
  width: 100%;
  margin-top: 0.25rem;
}

.auth-card__footer {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-brand {
    display: none;
  }

  .auth-card {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .auth-page {
    padding: 0.75rem;
  }

  .auth-shell {
    border-radius: var(--radius-lg);
  }

  .auth-field__label-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}
