/*!
 * auth.css - http://kodester.com/
 * Version - 2.5.0
 * Licensed under the MIT license - http://opensource.org/licenses/MIT
 *
 * Copyright (c) 2026 Kasanova
 */
 
/* Load color overrides agar [data-color="..."] bekerja di halaman auth */
@import url('/css/color.css');

.auth-page {
  display: grid;
  grid-template-columns: 3fr 2fr;
  min-height: 100vh;
  background: var(--bg);
}

/* ===== LEFT PANEL ===== */
.auth-left {
  background: var(--s3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: var(--grn);
  opacity: .04;
  border-radius: 50%;
}

.auth-left::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -40px;
  width: 180px;
  height: 180px;
  background: var(--grn);
  opacity: .03;
  border-radius: 50%;
}

.auth-left-content {
  text-align: center;
  max-width: 380px;
}

.auth-left .auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 36px;
}

.auth-left .auth-logo img {
  height: 28px;
}

.auth-left .auth-logo .dk { display: block; }
.auth-left .auth-logo .lt { display: none; }
[data-theme="light"] .auth-left .auth-logo .dk { display: none; }
[data-theme="light"] .auth-left .auth-logo .lt { display: block; }

.auth-left-img {
  width: 200px;
  max-width: 100%;
  margin: 0 auto 28px;
  display: block;
  border-radius: var(--r2);
  will-change: transform;
  animation: authImgFloat 4s ease-in-out infinite !important;
  animation-play-state: running !important;
}

@keyframes authImgFloat {
  0%   { transform: translateY(0px);   }
  50%  { transform: translateY(-14px); }
  100% { transform: translateY(0px);   }
}

.auth-left h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--tx);
  margin-bottom: 10px;
  line-height: 1.4;
}

.auth-left p {
  font-size: .85rem;
  color: var(--tx2);
  line-height: 1.6;
  margin-bottom: 28px;
}

.auth-left-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.auth-left-stats .stat {
  text-align: center;
}

.auth-left-stats .stat strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--grn);
  margin-bottom: 2px;
}

.auth-left-stats .stat span {
  font-size: .7rem;
  color: var(--tx3);
  font-weight: 500;
}

/* ===== RIGHT PANEL ===== */
.auth-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 32px;
  position: relative;
  border-left: 1px solid var(--bd);
}

.auth-right .auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--bd);
  background: var(--s3);
  color: var(--tx3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: .2s;
  font-size: .8rem;
}

.auth-right .auth-close:hover {
  border-color: var(--grn);
  color: var(--grn);
  background: var(--grng);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--tx);
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: .88rem;
  color: var(--tx2);
  line-height: 1.5;
}

.auth-subtitle a {
  font-weight: 700;
  color: var(--grn);
  transition: .15s;
}

.auth-subtitle a:hover {
  color: var(--grn2);
  text-decoration: underline;
}

/* Google Button */
.auth-google {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--bd2);
  border-radius: var(--r);
  background: var(--s3);
  color: var(--tx);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}

.auth-google:hover {
  border-color: var(--grn);
  background: var(--grng);
}

.auth-google svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bd);
}

.auth-divider span {
  font-size: .78rem;
  color: var(--tx3);
  font-weight: 500;
  white-space: nowrap;
}

/* ===== FORM ===== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--tx2);
}

/* Input with icon */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap > i:first-child {
  position: absolute;
  left: 14px;
  font-size: .88rem;
  color: var(--tx3);
  pointer-events: none;
  transition: .2s;
}

.auth-input-wrap:focus-within > i:first-child {
  color: var(--grn);
}

.auth-input-wrap input {
  width: 100%;
  height: 44px;
  background: var(--s3);
  border: 1px solid var(--bd2);
  border-radius: var(--r);
  padding: 0 42px 0 40px;
  font-size: .85rem;
  color: var(--tx);
  outline: none;
  transition: .2s;
}

.auth-input-wrap input::placeholder {
  color: var(--tx4);
}

.auth-input-wrap input:focus {
  border-color: var(--grn);
  box-shadow: 0 0 0 3px var(--grng);
}

.auth-input-wrap input.input-error {
  border-color: var(--rd);
  box-shadow: 0 0 0 3px rgba(231, 76, 60, .1);
}

/* Toggle password */
.toggle-pw {
  position: absolute;
  right: 4px;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--tx3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--r);
  font-size: .88rem;
  transition: .15s;
}

.toggle-pw:hover {
  color: var(--tx);
  background: var(--s4);
}

/* ===== PASSWORD STRENGTH ===== */
.pw-strength-bar {
  width: 100%;
  height: 3px;
  background: var(--bd);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 2px;
}

.pw-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width .3s ease, background .3s ease;
}

.pw-strength-fill.weak { width: 20%; background: var(--rd); }
.pw-strength-fill.fair { width: 40%; background: #f59e0b; }
.pw-strength-fill.good { width: 60%; background: #3b82f6; }
.pw-strength-fill.strong { width: 100%; background: var(--grn); }

.pw-requirements {
  display: none;
  flex-direction: column;
  gap: 3px;
  padding-top: 6px;
}

.pw-req {
  font-size: .72rem;
  color: var(--tx3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pw-req i { font-size: .6rem; color: var(--tx4); }
.pw-req.pass { color: var(--grn); }
.pw-req.pass i { color: var(--grn); }

.pw-match-error {
  display: none;
  font-size: .72rem;
  color: var(--rd);
  padding-top: 4px;
}

/* ===== ALERT / FLASH MESSAGES ===== */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r);
  font-size: .83rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.auth-alert i {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.auth-alert > div {
  flex: 1;
  min-width: 0;
}

.auth-alert strong {
  font-weight: 700;
}

.auth-alert-error {
  background: rgba(231,76,60,.08);
  border: 1px solid rgba(231,76,60,.25);
  color: #e74c3c;
}

.auth-alert-success {
  background: rgba(8,135,85,.08);
  border: 1px solid rgba(8,135,85,.25);
  color: var(--grn2);
}

[data-theme="light"] .auth-alert-error {
  background: rgba(231,76,60,.06);
  border-color: rgba(231,76,60,.2);
}

[data-theme="light"] .auth-alert-success {
  background: rgba(8,135,85,.06);
  border-color: rgba(8,135,85,.2);
}

/* ===== CHECKBOX ===== */
.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: .82rem;
  color: var(--tx2);
}

.auth-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 2px solid var(--bd2);
  border-radius: 4px;
  background: var(--s3);
  cursor: pointer;
  transition: .15s;
  position: relative;
}

.auth-check input[type="checkbox"]:checked {
  background: var(--grn);
  border-color: var(--grn);
}

.auth-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.auth-check a {
  color: var(--grn);
  font-weight: 600;
}

.auth-check a:hover {
  text-decoration: underline;
}

/* ===== AUTH ROW (Remember me + Forgot) ===== */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-forgot {
  font-size: .82rem;
  font-weight: 600;
  color: var(--grn);
  transition: .15s;
}

.auth-forgot:hover {
  color: var(--grn2);
  text-decoration: underline;
}

/* Back to login link */
.auth-back-link {
  font-size: .82rem;
  color: var(--tx3);
  text-align: center;
  margin-top: 4px;
}

.auth-back-link a {
  font-weight: 600;
  color: var(--grn);
  transition: .15s;
}

.auth-back-link a:hover {
  text-decoration: underline;
}

/* ===== SUBMIT ===== */
.auth-submit {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: var(--r);
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
  background: var(--grn);
  color: #fff;
  margin-top: 4px;
}

.auth-submit:hover {
  background: var(--grn2);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(8, 135, 85, .3);
}

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

.auth-submit:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ===== MULTI-STEP INDICATOR ===== */
.auth-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
}

.auth-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.auth-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--s3);
  border: 2px solid var(--b1);
  color: var(--tx2);
  font-size: .8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s, border-color .25s, color .25s;
}

.auth-step span {
  font-size: .78rem;
  color: var(--tx2);
  font-weight: 500;
  transition: color .25s;
}

.auth-step.active .auth-step-num {
  background: var(--grn);
  border-color: var(--grn);
  color: #fff;
}

.auth-step.active span {
  color: var(--tx);
  font-weight: 700;
}

.auth-step.done .auth-step-num {
  background: var(--grn);
  border-color: var(--grn);
  color: #fff;
}

.auth-step-line {
  flex: 1;
  height: 2px;
  background: var(--b1);
  margin: 0 10px;
  border-radius: 2px;
  transition: background .25s;
}

.auth-step-line.done {
  background: var(--grn);
}

/* Step 2 specific */
.auth-step2-hint {
  font-size: .82rem;
  color: var(--tx2);
  margin-bottom: 18px;
  line-height: 1.5;
}

.auth-step-optional {
  color: var(--tx3, var(--tx2));
  opacity: .7;
  font-size: .78rem;
}

.auth-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-field-hint {
  font-size: .75rem;
  color: var(--tx2);
  margin-top: 5px;
  display: block;
  opacity: .75;
}

.auth-step2-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.auth-step2-actions .auth-submit {
  flex: 1;
  margin-top: 0;
}

.auth-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  height: 44px;
  border-radius: var(--r);
  background: var(--s3);
  border: 1px solid var(--b1);
  color: var(--tx2);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, color .2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.auth-btn-back:hover {
  background: var(--s2);
  color: var(--tx);
}

/* ===== FORCE ANIMATION — override prefers-reduced-motion & touch overrides ===== */
@media (prefers-reduced-motion: reduce) {
  .auth-left-img {
    animation: authImgFloat 4s ease-in-out infinite !important;
    animation-play-state: running !important;
    animation-duration: 4s !important;
    animation-iteration-count: infinite !important;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-left { display: none; }
  .auth-right {
    padding: 32px 24px;
  }
  .auth-title { font-size: 1.3rem; }
  .auth-subtitle { margin-bottom: 24px; }
}

@media (max-width: 480px) {
  .auth-right { padding: 28px 20px; }
  .auth-title { font-size: 1.15rem; }
  .auth-input-wrap input { height: 42px; font-size: .82rem; }
  .auth-submit { height: 42px; font-size: .85rem; }
  .auth-check { font-size: .78rem; }
}