/* ==========================================================================
   AUTH — halaman login, register, forgot-password (design-v2)
   ========================================================================== */

body.auth-page {
  min-height: 100vh;
  margin: 0;
  padding: 28px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ds-bg);
  color: var(--ds-ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: background .2s, color .2s;
}

.auth-shell { width: 100%; max-width: 430px; }

body.auth-register-page .auth-shell { max-width: 520px; }

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ds-ink);
  text-decoration: none;
}
.auth-brand img { width: 34px; height: 34px; display: block; border-radius: 9px; }

.auth-brand-name {
  color: var(--ds-ink);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.auth-brand-subtitle {
  margin-top: 4px;
  color: var(--ds-ink-3);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.auth-theme-toggle {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ds-ink-3);
  background: var(--ds-card);
  border: 1px solid var(--ds-line);
  border-radius: 11px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.auth-theme-toggle:hover { color: var(--ds-blue-ink); border-color: var(--ds-line-strong); }
.auth-theme-toggle svg { width: 18px; height: 18px; }

.auth-card {
  width: 100%;
  padding: 38px;
  background: var(--ds-card);
  border: 1px solid var(--ds-line);
  border-radius: 22px;
  box-shadow: var(--ds-shadow-md);
}

.auth-title {
  margin: 0 0 7px;
  color: var(--ds-ink);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.035em;
}

.auth-sub {
  margin: 0 0 26px;
  color: var(--ds-ink-2);
  font-size: .84rem;
  line-height: 1.65;
}

.auth-form-group { margin-bottom: 17px; }

.auth-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ds-ink);
  font-size: .78rem;
  font-weight: 650;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  color: var(--ds-ink);
  background: var(--ds-bg-soft);
  border: 1px solid var(--ds-line);
  border-radius: 11px;
  outline: none;
  font: inherit;
  font-size: .88rem;
  transition: border-color .2s, box-shadow .2s;
}
.auth-input::placeholder { color: var(--ds-ink-3); opacity: .75; }
.auth-input:focus {
  border-color: var(--ds-blue);
  box-shadow: 0 0 0 3px var(--ds-blue-soft);
}

.auth-form-help {
  display: block;
  margin-top: 6px;
  color: var(--ds-ink-3);
  font-size: .68rem;
  line-height: 1.45;
}

.auth-form-hint {
  display: block;
  margin-top: 6px;
  color: var(--ds-ink-3);
  font-size: .69rem;
  line-height: 1.45;
}

.auth-btn {
  width: 100%;
  margin-top: 2px;
  padding: 13px 16px;
  color: #fff;
  background: var(--ds-btn-bg);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .24);
  cursor: pointer;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  transition: background .2s, transform .2s;
}
.auth-btn:hover { background: var(--ds-btn-bg-hover); transform: translateY(-1px); }
.auth-btn:active { transform: translateY(0); }

.auth-links { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--ds-line); }
.auth-link { margin: 9px 0 0; color: var(--ds-ink-3); font-size: .78rem; line-height: 1.5; text-align: center; }
.auth-link:first-child { margin-top: 0; }
.auth-link a { color: var(--ds-blue-ink); font-weight: 600; text-decoration: none; }
.auth-link a:hover { text-decoration: underline; }

.auth-register-prompt {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.auth-register-prompt .auth-register-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 20px;
  border: 1px solid var(--ds-line-strong);
  border-radius: 11px;
  background: var(--ds-blue-soft);
  color: var(--ds-blue-ink);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s, border-color .2s, transform .2s;
}

.auth-register-prompt .auth-register-link:hover {
  border-color: var(--ds-blue);
  background: var(--ds-line-strong);
  text-decoration: none;
  transform: translateY(-1px);
}

.auth-alert { margin-bottom: 18px; padding: 12px 14px; border-radius: 11px; font-size: .79rem; line-height: 1.55; }
.auth-alert-error { color: var(--ds-danger); background: var(--ds-danger-soft); border: 1px solid rgba(220, 38, 38, .25); }
.auth-alert-success { color: var(--ds-blue-ink); background: var(--ds-blue-soft); border: 1px solid rgba(37, 99, 235, .25); }

body.auth-reset-page .auth-shell { max-width: 460px; }
body.auth-reset-page .auth-card { border-top: 3px solid var(--ds-blue); }

.reset-intro { display: flex; align-items: center; gap: 13px; margin: 0 0 18px; }
.reset-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--ds-blue), #4f46e5);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(59, 130, 246, .24);
}
.reset-mark svg { width: 22px; height: 22px; }
.reset-eyebrow {
  margin: 0 0 4px;
  color: var(--ds-blue-ink);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.reset-intro .auth-title { margin: 0; }
.reset-sub {
  margin: 0 0 22px;
  padding: 12px 14px;
  color: var(--ds-ink-2);
  background: var(--ds-blue-soft);
  border: 1px solid var(--ds-line);
  border-radius: 12px;
  font-size: .78rem;
  line-height: 1.6;
}
.auth-reset-page .auth-note {
  margin: 0 0 18px;
  padding: 11px 13px;
  color: var(--ds-ink-2);
  background: var(--ds-bg-soft);
  border: 1px solid var(--ds-line);
  border-radius: 11px;
  font-size: .76rem;
  line-height: 1.6;
}
.auth-reset-page .auth-note strong { color: var(--ds-ink); }
.auth-reset-page .pw-wrap { position: relative; }
.auth-reset-page .pw-wrap .auth-input { padding-right: 68px; }
.auth-reset-page .pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  padding: 6px 10px;
  color: var(--ds-blue-ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
}
.auth-reset-page .pw-toggle:hover { background: var(--ds-blue-soft); }
.auth-reset-page .auth-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.auth-reset-retry {
  display: block;
  width: 100%;
  margin-top: 2px;
  padding: 12px 16px;
  color: var(--ds-blue-ink);
  background: var(--ds-blue-soft);
  border: 1px solid var(--ds-line-strong);
  border-radius: 11px;
  text-align: center;
  text-decoration: none;
  font-size: .85rem;
  font-weight: 700;
  transition: border-color .2s, background .2s, transform .2s;
}
.auth-reset-retry:hover {
  border-color: var(--ds-blue);
  background: var(--ds-line-strong);
  transform: translateY(-1px);
}

.auth-register-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 16px;
}

.auth-register-form .auth-form-group { margin-bottom: 0; }
.auth-register-form .auth-form-group:nth-of-type(5),
.auth-register-form .auth-btn,
.auth-register-form .auth-links { grid-column: 1 / -1; }
.auth-register-form .auth-links { margin-top: 2px; }

.theme-icon-light { display: none; }
html[data-theme="light"] .theme-icon-dark { display: none; }
html[data-theme="light"] .theme-icon-light { display: block; }

@media (max-height: 680px) and (min-width: 481px) {
  body.auth-login-page {
    align-items: flex-start;
    padding-block: 16px;
  }
  .auth-login-page .auth-topbar { margin-bottom: 10px; }
  .auth-login-page .auth-card { padding: 28px; }
  .auth-login-page .auth-sub { margin-bottom: 20px; }
  .auth-login-page .auth-form-group { margin-bottom: 14px; }
  .auth-login-page .auth-links { margin-top: 16px; padding-top: 14px; }

  body.auth-forgot-page {
    align-items: flex-start;
    justify-content: flex-start;
    padding-block: 16px;
  }
  .auth-forgot-page .auth-topbar { margin-bottom: 10px; }
  .auth-forgot-page .auth-card { padding: 28px; }
  .auth-forgot-page .auth-sub { margin-bottom: 18px; }
  .auth-forgot-page .auth-form-group { margin-bottom: 14px; }
  .auth-forgot-page .auth-links { margin-top: 16px; padding-top: 14px; }
}

@media (max-width: 480px) {
  body.auth-page { align-items: flex-start; padding: 22px 14px 34px; }
  .auth-shell { max-width: 100%; }
  .auth-card { padding: 28px 20px; border-radius: 18px; }
  .auth-title { font-size: 1.4rem; }
}

@media (max-width: 560px) {
  .auth-register-form { grid-template-columns: minmax(0, 1fr); }
  .auth-register-form .auth-form-group:nth-of-type(5),
  .auth-register-form .auth-btn,
  .auth-register-form .auth-links { grid-column: auto; }
}
