@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* =========================
   AUTH PAGE (LOGIN & REGISTER)
========================= */

body {
  background: radial-gradient(circle at top, #1e1b4b, #020617);
}

/* =========================
   BOX UTAMA
========================= */
.auth-box {
  width: 400px;
  margin: 80px auto;
  background: #111827;
  padding: 28px;
  border-radius: 18px;
  box-shadow: 0 0 30px rgba(0,0,0,.6);
}

/* TITLE */
.auth-box h2 {
  margin-top: 0;
  text-align: center;
  margin-bottom: 22px;
}

/* FORM */
.auth-box .form-group {
  margin-bottom: 16px;
}

/* LABEL */
.auth-box label {
  font-size: 13px;
  color: #9ca3af;
}

/* =========================
   INPUT
========================= */
.auth-box input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: #020617;
  color: #e5e7eb;
}

.auth-box input::placeholder {
  color: #6b7280;
}

/* =========================
   PASSWORD FIELD (FIX ICON 👁️)
========================= */
.password-container {
  position: relative;
  width: 100%;
}

.password-container input {
  width: 100%;
  padding-right: 46px; /* ruang untuk icon */
}

/* 🔥 FIX UTAMA: override button global */
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);

  /* ⛔ cegah full width */
  width: auto !important;
  min-width: auto !important;
  max-width: none !important;

  padding: 0;
  margin: 0;

  background: transparent;
  border: none;
  cursor: pointer;

  font-size: 18px;
  line-height: 1;
  color: #9ca3af;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================
   SUBMIT BUTTON
========================= */
.auth-box button[type="submit"],
.auth-submit {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  color: white;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  margin-top: 8px;
}

.auth-box button[type="submit"]:hover,
.auth-submit:hover {
  opacity: 0.9;
}

/* =========================
   LINK
========================= */
.auth-link {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
}

.auth-link a {
  color: #a855f7;
  text-decoration: none;
}

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

.auth-home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-decoration: none;
}

.auth-home-link:hover {
  text-decoration: none;
  opacity: 0.85;
}

/* =========================
   ERROR & SUCCESS
========================= */
.error-message {
  font-size: 12px;
  color: #ef4444;
  margin-top: 5px;
}

.success-message {
  font-size: 12px;
  color: #22c55e;
  margin-top: 5px;
}

.form-error {
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
  color: #ef4444;
}

.form-success {
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
  color: #22c55e;
}

.auth-divider {
  margin: 18px 0;
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
}

.otp-box {
  margin-top: 10px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 14px;
  padding: 16px;
}

.otp-box h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.otp-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.otp-row input {
  flex: 1;
  min-height: 42px;
}

.btn-otp {
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: #1f2937;
  color: #e5e7eb;
  cursor: pointer;
  font-weight: 600;
  min-height: 42px;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-otp:hover {
  background: #111827;
}

.btn-otp:active {
  transform: scale(0.98);
}

.captcha-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.captcha-image {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  background: #020617;
  color: #e5e7eb;
  border: 1px solid #1f2937;
  font-weight: 600;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.captcha-image img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  max-height: 150px;
}

.btn-otp-primary {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.otp-box .form-error,
.otp-box .form-success {
  margin-top: 10px;
}

@media (max-width: 480px) {
  .otp-row {
    flex-direction: column;
  }

  .btn-otp {
    width: 100%;
  }

  .auth-box {
    padding: 16px;
  }

  .captcha-row {
    flex-direction: column;
    gap: 8px;
  }

  .captcha-image {
    width: 100%;
    padding: 14px;
    min-height: 100px;
    font-size: 14px;
    flex: unset;
  }

  .captcha-image img {
    max-height: 220px;
  }

  .captcha-refresh {
    width: 100%;
  }

  .btn-otp {
    padding: 10px;
    font-size: 14px;
  }
}

/* =========================
   PASSWORD STRENGTH
========================= */
.password-strength {
  margin-top: 8px;
  font-size: 12px;
  color: #9ca3af;
}

.strength-bar {
  height: 6px;
  background: #1f2937;
  border-radius: 6px;
  margin-top: 6px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #22c55e, #38bdf8, #a855f7, #f97316);
  background-size: 200% 100%;
  transition: width 0.3s;
  animation: strength-rgb-shift 2.5s linear infinite;
}

@keyframes strength-rgb-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* =========================
   VALIDATION RULES
========================= */
.validation-rules {
  background: #020617;
  padding: 12px;
  border-radius: 10px;
  margin: 14px 0;
  font-size: 12px;
}

.validation-rules ul {
  padding-left: 16px;
  margin: 6px 0 0;
}

.validation-rules li {
  color: #9ca3af;
}

/* =========================
   RESPONSIVE (MOBILE)
========================= */
@media (max-width: 768px) {
  body {
    padding: 10px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .auth-box {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    border-radius: 14px;
  }

  h2 {
    font-size: 22px;
    text-align: center;
  }

  input {
    font-size: 15px;
  }

  button[type="submit"] {
    font-size: 15px;
  }

  /* icon 👁️ lebih nyaman di HP */
  .password-toggle {
    font-size: 20px;
    right: 10px;
  }

  /* CAPTCHA RESPONSIVE MOBILE */
  .captcha-row {
    flex-direction: column;
    gap: 10px;
  }

  .captcha-image {
    width: 100%;
    padding: 16px;
    min-height: 90px;
    font-size: 16px;
  }

  .captcha-image img {
    max-height: 200px;
  }

  .captcha-refresh {
    width: 100%;
  }
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.auth-actions #login-btn {
  flex: 1;
}

.auth-forgot {
  font-size: 13px;
  color: #a855f7;
  text-decoration: none;
  white-space: nowrap;
}

.auth-forgot:hover {
  text-decoration: underline;
}

.auth-forgot-inline {
  display: inline-block;
  margin: -4px 0 10px;
}

@media (max-width: 480px) {
  .auth-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-forgot {
    text-align: center;
  }
}

/* =========================
   LOGIN ENHANCEMENTS
========================= */

:root {
  --auth-bg-1: #0b1020;
  --auth-bg-2: #08101a;
  --auth-surface: #0f172a;
  --auth-border: rgba(148, 163, 184, 0.18);
  --auth-text: #e2e8f0;
  --auth-muted: #94a3b8;
  --auth-accent: #16f2b3;
  --auth-accent-2: #2fb5ff;
  --auth-danger: #ef4444;
}

body.auth-page {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(22, 242, 179, 0.15), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(47, 181, 255, 0.18), transparent 40%),
    linear-gradient(160deg, var(--auth-bg-1), var(--auth-bg-2));
  color: var(--auth-text);
  min-height: 100vh;
  margin: 0;
  padding: 48px 16px;
}

.auth-shell {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 360px);
  gap: 32px;
  align-items: center;
}

.auth-shell .auth-box {
  margin: 0;
  width: 100%;
  max-width: 420px;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.96), rgba(10, 15, 30, 0.9));
  border: 1px solid var(--auth-border);
  box-shadow: 0 24px 50px rgba(2, 6, 23, 0.55);
}

.auth-header {
  margin-bottom: 20px;
  text-align: left;
}

.auth-header h2 {
  text-align: left;
  margin-bottom: 8px;
}

.auth-eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--auth-muted);
  margin-bottom: 8px;
}

.auth-subtitle {
  margin: 0 0 6px 0;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.4;
}

.auth-info {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(22, 242, 179, 0.25);
  background: rgba(22, 242, 179, 0.08);
}

.auth-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.auth-badges span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(47, 181, 255, 0.12);
  color: var(--auth-text);
  font-size: 12px;
  border: 1px solid rgba(47, 181, 255, 0.25);
}

.auth-note {
  margin: 0;
  font-size: 12px;
  color: var(--auth-muted);
  line-height: 1.5;
}

.auth-shell .auth-box button[type="submit"],
.auth-submit {
  background: linear-gradient(120deg, var(--auth-accent), var(--auth-accent-2));
  box-shadow: 0 10px 20px rgba(22, 242, 179, 0.15);
}

.auth-link a,
.auth-forgot {
  color: var(--auth-accent-2);
}

.error-message,
.form-error {
  color: var(--auth-danger);
}

.auth-side {
  width: 100%;
}

.auth-side-card {
  padding: 24px;
  border-radius: 20px;
  background: rgba(10, 14, 28, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.auth-side-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--auth-text);
}

.auth-side-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.6;
}

.auth-side-highlight {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(47, 181, 255, 0.1);
  border: 1px dashed rgba(47, 181, 255, 0.35);
}

.auth-side-highlight span {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--auth-accent-2);
  margin-bottom: 6px;
}

.auth-side-highlight p {
  margin: 0;
  color: var(--auth-text);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 920px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-box {
    max-width: 100%;
  }
}

