/* ==========================================================================
   Dhanora — Auth Styles (Login & Registration)
   Green & White Fintech Theme
   ========================================================================== */

:root {
  --pd-emerald-50: #ecfdf5;
  --pd-emerald-100: #d1fae5;
  --pd-emerald-200: #a7f3d0;
  --pd-emerald-400: #34d399;
  --pd-emerald-500: #10b981;
  --pd-emerald-600: #059669;
  --pd-emerald-700: #047857;
  --pd-emerald-soft: #7bcbb0;

  --pd-ink-900: #111827;
  --pd-ink-700: #374151;
  --pd-ink-500: #6b7280;
  --pd-ink-400: #9ca3af;

  --pd-border: #e5e7eb;
  --pd-input-bg: #f9fafb;
  --pd-surface: #ffffff;
  --pd-danger: #dc2626;
  --pd-danger-bg: #fef2f2;
  --pd-shadow-card: 0 22px 55px rgba(4, 120, 87, 0.12), 0 6px 18px rgba(17, 24, 39, 0.04);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--pd-ink-900);
  -webkit-font-smoothing: antialiased;
}

/* Subtle mint-green & white grid background matching reference */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
  background-color: #f4fbf7;
  background-image:
    radial-gradient(circle at 12% 14%, rgba(16, 185, 129, 0.16) 0%, transparent 42%),
    radial-gradient(circle at 88% 86%, rgba(5, 150, 105, 0.18) 0%, transparent 45%),
    linear-gradient(to right, rgba(16, 185, 129, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 185, 129, 0.045) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 34px 34px, 34px 34px;
}

.auth-wrapper {
  width: 100%;
  max-width: 428px;
  position: relative;
  z-index: 1;
}

/* Main Floating Auth Card */
.auth-card {
  background: var(--pd-surface);
  border-radius: 22px;
  box-shadow: var(--pd-shadow-card);
  border: 1px solid rgba(16, 185, 129, 0.12);
  overflow: hidden;
  animation: cardFadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Emerald Gradient Header Banner */
.auth-header {
  background: linear-gradient(135deg, #10b981 0%, #059669 52%, #047857 100%);
  padding: 22px 24px 18px;
  text-align: center;
  position: relative;
}

.auth-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.18) 0%, transparent 55%);
  pointer-events: none;
}

.brand-pill,
.brand-pill:hover,
.brand-pill:focus,
.brand-pill:visited {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: #ffffff;
  border-radius: 14px;
  padding: 9px 20px;
  box-shadow: 0 8px 20px rgba(4, 120, 87, 0.22);
  margin-bottom: 12px;
  text-decoration: none !important;
}

.dhanora-logo-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #ffffff;
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
  font-size: 15px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.28);
}

.brand-text-logo {
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #10b981 0%, #059669 55%, #047857 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #059669;
  line-height: 1.05;
  display: inline-block;
  text-decoration: none !important;
}

.auth-header-subtitle {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.7px;
  text-transform: uppercase;
}

/* Card Body */
.auth-body {
  padding: 26px 26px 24px;
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--pd-ink-900);
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  text-align: center;
}

.auth-subtitle {
  font-size: 13.5px;
  color: var(--pd-ink-500);
  margin: 0 0 22px;
  text-align: center;
}

/* Invite Pill Banner (Registration) */
.invite-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--pd-emerald-50);
  border: 1px solid #b8eed4;
  border-radius: 11px;
  padding: 9px 13px;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pd-emerald-700);
}

.invite-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Form Labels & Input Groups */
.form-field {
  margin-bottom: 16px;
}

.form-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.pd-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.55px;
  text-transform: uppercase;
  color: var(--pd-ink-700);
  margin-bottom: 6px;
}

.form-field-label-row .pd-label {
  margin-bottom: 0;
}

.pd-input-group {
  display: flex;
  align-items: center;
  height: 47px;
  background: var(--pd-input-bg);
  border: 1.5px solid var(--pd-border);
  border-radius: 12px;
  padding: 0 13px;
  gap: 10px;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.pd-input-group:focus-within {
  background: #ffffff;
  border-color: var(--pd-emerald-500);
  box-shadow: 0 0 0 3.5px rgba(16, 185, 129, 0.14);
}

.pd-input-group.is-invalid {
  border-color: var(--pd-danger);
  background: #fffafa;
}

.pd-input-group.is-invalid:focus-within {
  box-shadow: 0 0 0 3.5px rgba(220, 38, 38, 0.12);
}

.pd-input-group.is-valid {
  border-color: var(--pd-emerald-500);
}

.pd-input-icon {
  color: var(--pd-emerald-500);
  font-size: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.pd-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--pd-ink-900);
}

.pd-input::placeholder {
  color: var(--pd-ink-400);
  font-weight: 400;
}

.pd-input:disabled {
  color: var(--pd-ink-500);
  cursor: not-allowed;
}

.pd-eye-btn {
  border: 0;
  background: transparent;
  color: var(--pd-ink-400);
  padding: 4px;
  margin-right: -4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.pd-eye-btn:hover {
  color: var(--pd-emerald-600);
  background: rgba(16, 185, 129, 0.08);
}

.field-error {
  display: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--pd-danger);
  margin-top: 5px;
}

.field-error.show {
  display: block;
}

/* Referral Code Dashed Box */
.locked-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--pd-emerald-50);
  color: var(--pd-emerald-600);
  border: 1px solid #b8eed4;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.locked-badge:hover {
  background: var(--pd-emerald-100);
}

.pd-referral-box {
  display: flex;
  align-items: center;
  height: 47px;
  background: #f2fcf7;
  border: 1.5px dashed var(--pd-emerald-500);
  border-radius: 12px;
  padding: 0 13px;
  gap: 10px;
}

.pd-referral-box.unlocked {
  border-style: solid;
  background: var(--pd-input-bg);
  border-color: var(--pd-border);
}

.pd-referral-box.unlocked:focus-within {
  background: #ffffff;
  border-color: var(--pd-emerald-500);
  box-shadow: 0 0 0 3.5px rgba(16, 185, 129, 0.14);
}

.pd-referral-input {
  font-weight: 700;
  color: var(--pd-emerald-700);
  letter-spacing: 0.4px;
}

.pd-referral-helper {
  font-size: 11.5px;
  color: var(--pd-ink-400);
  margin-top: 6px;
}

/* Remember me & Forgot password row */
.auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 20px;
  font-size: 13.5px;
}

.pd-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--pd-ink-700);
  font-weight: 500;
}

.pd-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.pd-check input[type="checkbox"]:checked::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-0.5px, -0.5px);
}

.pd-link {
  color: var(--pd-emerald-600);
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}

.pd-link:hover {
  color: var(--pd-emerald-700);
  text-decoration: underline;
}

/* Primary & Secondary CTA Buttons */
.btn-pd-primary {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #0ea66f 0%, #059669 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.25);
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn-pd-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #0b9664 0%, #047857 100%);
  box-shadow: 0 10px 24px rgba(5, 150, 105, 0.32);
  transform: translateY(-1px);
}

.btn-pd-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-pd-primary.is-muted-ready {
  background: var(--pd-emerald-soft);
  box-shadow: none;
}

.btn-pd-primary.is-muted-ready:hover:not(:disabled) {
  background: #67bf9f;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.2);
}

.btn-pd-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.auth-divider-text {
  text-align: center;
  font-size: 13px;
  color: var(--pd-ink-400);
  margin: 16px 0 12px;
  font-weight: 500;
}

.btn-pd-outline {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--pd-emerald-500);
  border-radius: 12px;
  background: #ffffff;
  color: var(--pd-emerald-600);
  font-size: 14.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-pd-outline:hover {
  background: var(--pd-emerald-50);
  border-color: var(--pd-emerald-600);
  color: var(--pd-emerald-700);
}

/* Security Footer inside card */
.ssl-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--pd-ink-500);
  font-weight: 500;
}

.ssl-footer i {
  color: var(--pd-emerald-500);
  font-size: 14px;
}

/* Alert Feedback Banner */
.pd-alert {
  display: none;
  align-items: flex-start;
  gap: 10px;
  border-radius: 12px;
  padding: 11px 13px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.pd-alert.show {
  display: flex;
}

.pd-alert-danger {
  background: var(--pd-danger-bg);
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.pd-alert-success {
  background: var(--pd-emerald-50);
  border: 1px solid #a7f3d0;
  color: var(--pd-emerald-700);
}

/* ==========================================================================
   OTP Verification Interface
   ========================================================================== */
.otp-panel {
  display: none;
  margin-top: 4px;
  margin-bottom: 16px;
  padding: 16px;
  background: #f6fdf9;
  border: 1.5px solid #b8eed4;
  border-radius: 16px;
  animation: cardFadeUp 0.25s ease;
}

.otp-panel.show {
  display: block;
}

.otp-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.otp-panel-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--pd-ink-900);
  display: flex;
  align-items: center;
  gap: 6px;
}

.otp-panel-title i {
  color: var(--pd-emerald-600);
}

.otp-boxes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.otp-digit {
  width: 100%;
  height: 46px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--pd-ink-900);
  background: #ffffff;
  border: 1.5px solid #d1d5db;
  border-radius: 11px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.otp-digit:focus {
  border-color: var(--pd-emerald-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.otp-digit.filled {
  border-color: var(--pd-emerald-500);
  background: #f9fefb;
}

.otp-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--pd-ink-500);
  margin-bottom: 14px;
}

.btn-resend-otp {
  border: 0;
  background: transparent;
  color: var(--pd-emerald-600);
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.btn-resend-otp:disabled {
  color: var(--pd-ink-400);
  cursor: not-allowed;
}

/* Password Strength Meter (Subtle inline indicator) */
.password-strength-wrap {
  display: none;
  margin-top: 6px;
}

.password-strength-wrap.show {
  display: block;
}

.password-strength-bar {
  height: 4px;
  border-radius: 99px;
  background: #e5e7eb;
  overflow: hidden;
  margin-bottom: 4px;
}

.password-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  transition: width 0.25s ease, background-color 0.25s ease;
}

.password-strength-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--pd-ink-500);
}

/* Modal Overrides (Bootstrap 5) */
.pd-modal .modal-content {
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(4, 120, 87, 0.2);
}

.pd-modal .modal-header {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-bottom: 0;
  padding: 16px 22px;
}

.pd-modal .modal-title {
  font-size: 16px;
  font-weight: 700;
}

.pd-modal .btn-close {
  filter: brightness(0) invert(1);
}

.pd-modal .modal-body {
  padding: 22px;
}

.success-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--pd-emerald-50);
  border: 2px solid var(--pd-emerald-200);
  color: var(--pd-emerald-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .auth-page {
    padding: 16px 12px;
  }

  .auth-body {
    padding: 22px 18px 20px;
  }

  .otp-boxes {
    gap: 6px;
  }

  .otp-digit {
    height: 42px;
    font-size: 16px;
  }
}
