/* -------- Base / Reset -------- */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: #1f2937;
  /* gray-800 */
  background:
    radial-gradient(1200px 600px at 10% -10%, #e8f5f3 0%, rgba(232, 245, 243, 0) 60%),
    radial-gradient(900px 500px at 110% 10%, #f0f7ff 0%, rgba(240, 247, 255, 0) 60%),
    #f7f7f8;
}

/* -------- Wrapper / Card -------- */
.auth-wrapper {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .04);
  padding: 28px;
  border: 1px solid #eef1f5;
}

/* -------- Brand / Header -------- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f766e, #0ea5a3);
}

.brand h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 700;
  letter-spacing: .2px;
  color: #0f766e;
}

.auth-title {
  margin: 10px 0 4px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: #0b342f;
}

.auth-subtitle {
  margin: 0 0 16px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

/* -------- Alerts -------- */
.message {
  font-size: 14px;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 14px;
  border: 1px solid transparent;
}

.message.error {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.message.success {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

/* -------- Form -------- */
.form-group {
  margin-bottom: 14px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
  color: #374151;
}

.input-wrap {
  position: relative;
}

.input {
  width: 100%;
  padding: 12px 44px 12px 12px;
  /* space for icon/button */
  border: 1.2px solid #e5e7eb;
  border-radius: 12px;
  outline: 0;
  background: #fff;
  color: #111827;
  font-size: 14px;
  transition: .2s border, .2s box-shadow;
}

.input:focus {
  border-color: #0ea5a3;
  box-shadow: 0 0 0 4px rgba(14, 165, 163, .12);
}

.input::placeholder {
  color: #9ca3af;
}

.toggle-pass {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  background: #004a97; /* biru seperti contoh */
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white; /* warna ikon */
  font-size: 18px; 
}

.toggle-pass:hover {
  background: #003c7a;
}

/* Saat password ditampilkan → ganti menjadi eye-slash */
.toggle-pass.show i {
  content: "\f070"; /* fa-eye-slash */
}

.toggle-pass.show i::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  content: "\f070"; /* eye-slash */
}

.toggle-pass:focus-visible {
  outline: 2px solid #0ea5a3;
}

input:invalid[required] {
  border-color: #fecaca;
}

input:invalid[required]:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .12);
}

/* -------- Button -------- */
.btn {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, filter .12s ease;
}

.btn-primary {
  background: #0f766e;
  color: #fff;
  box-shadow: 0 4px 16px rgba(15, 118, 110, .18);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 118, 110, .25);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* -------- Footer links -------- */
.form-extra {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 14px;
  gap: 8px;
  font-size: 13px;
}

a {
  color: #0f766e;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.register-link {
  text-align: center;
  margin-top: 10px;
  font-size: 14px;
  color: #4b5563;
}

/* -------- Small screens -------- */
@media (max-width:420px) {
  .auth-card {
    padding: 22px;
    border-radius: 14px;
  }

  .auth-title {
    font-size: 20px;
  }
}

/* ===== Animations ===== */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeAway {
  to {
    opacity: 0;
    transform: translateY(6px) scale(.99);
  }
}

.auth-card {
  animation: riseIn .28s ease-out both;
  will-change: transform, box-shadow;
}

@media (hover:hover) {
  .auth-card:hover {
    box-shadow: 0 10px 36px rgba(0, 0, 0, .10), 0 4px 14px rgba(0, 0, 0, .06);
    transform: translateY(-1px);
  }
}

/* ===== Role tabs: SLIDER (tanpa ::before) ===== */
.role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  position: relative;
  background: #f3f4f6;
  padding: 6px;
  border-radius: 12px;
  margin: 10px auto 18px;
  width: max(220px, 60%);
  min-width: 220px;
}

.role-tabs .slider {
  position: absolute;
  inset: 6px auto 6px 6px;
  width: calc(50% - 6px);
  border-radius: 10px;
  background: #0f766e;
  transition: transform .25s ease;
  will-change: transform;
  z-index: 0;
}

.role-tabs[data-active="peminjam"] .slider {
  transform: translateX(100%);
}

.role-tabs[data-active="donatur"] .slider {
  transform: translateX(0%);
}

.role-btn {
  appearance: none;
  border: 0;
  background: transparent;
  position: relative;
  z-index: 1;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  color: #374151;
  transition: color .2s ease, transform .06s ease;
}

.role-btn.active {
  color: #fff;
}

.role-btn:active {
  transform: translateY(1px);
}

/* kecil saja, agar rapi */
.cap-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px
}

.cap-pill {
  padding: 8px 12px;
  border-radius: 10px;
  background: #eef2ff;
  color: #1e40af;
  font-weight: 700
}

.cap-refresh {
  border: 0;
  background: #2563eb;
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer
}

.cap-refresh[disabled] {
  opacity: .6;
  cursor: progress
}

/* auto-hide message */
.message.fade-out {
  animation: fadeOut .5s ease forwards
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-4px);
    visibility: hidden
  }
}

/* ===== Page exit (opsional bila mau dipakai) ===== */
body.fade-out .auth-card {
  animation: fadeAway .16s ease-in forwards;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {

  .auth-card,
  .btn,
  .role-tabs .slider {
    animation: none !important;
    transition: none !important;
  }
}

.dev-link {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #f0f9ff;
  border: 1px solid #bae6fd
}