/* ==========================================================================
   Denarify Production UI Components
   Enterprise Modal Dialogs, Native Input Systems & Financial Notifications
   ========================================================================== */

/* --- Backdrop & Overlay --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  position: relative;
  background: #0c0d10;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: #ffffff;
  padding: 36px 32px;
  transform: translateY(18px) scale(0.98);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.is-active .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 22px;
  right: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.modal-header h3 {
  font-family: var(--font-display, "Inter Tight", sans-serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: #ffffff;
}

.modal-header p {
  color: rgba(255, 255, 255, 0.64);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 28px;
}

/* --- Form Controls --- */
.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 7px;
}

.form-group label span.opt {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
  font-size: 12px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: #14161a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px 14px;
  color: #ffffff;
  font-family: var(--font-body, "Inter", sans-serif);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form-input::placeholder, .form-textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary, #494fdf);
  box-shadow: 0 0 0 3px rgba(73, 79, 223, 0.25);
  background: #181b20;
}

.form-select option {
  background: #14161a;
  color: #ffffff;
}

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

@media (max-width: 500px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-foot-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.5;
  margin: 16px 0 24px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-block {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  font-size: 15px;
  font-weight: 500;
  padding: 13px 20px;
  border-radius: 10px;
}

/* --- Submit Button Loading State --- */
.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btnSpinner 0.6s linear infinite;
}

@keyframes btnSpinner {
  to { transform: rotate(360deg); }
}

/* --- Feedback Success Panel --- */
.feedback-success {
  text-align: center;
  padding: 8px 4px 4px;
}

.success-icon-badge {
  width: 56px;
  height: 56px;
  background: rgba(0, 168, 126, 0.12);
  border: 1px solid rgba(0, 168, 126, 0.3);
  color: #20e0a4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 24px;
}

.success-title {
  font-family: var(--font-display, "Inter Tight", sans-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: #ffffff;
}

.success-description {
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 24px;
}

.receipt-card {
  background: #131519;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
  text-align: left;
  font-size: 13px;
  margin-bottom: 24px;
}

.receipt-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
}

.receipt-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.receipt-item strong {
  color: #ffffff;
  font-weight: 500;
}

.receipt-item .badge-pill {
  font-size: 11px;
  background: rgba(0, 168, 126, 0.15);
  color: #34d399;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #14161a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 14px 18px;
  color: #ffffff;
  min-width: 280px;
  max-width: 360px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
  transform: translateX(120%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.toast.toast-show {
  transform: translateX(0);
}

.toast.toast-success {
  border-left: 3px solid #00a87e;
}

.toast-icon {
  font-size: 16px;
  line-height: 1;
  margin-top: 2px;
  color: #00a87e;
}

.toast-content h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 3px;
  color: #ffffff;
}

.toast-content p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.68);
  margin: 0;
  line-height: 1.4;
}

/* --- User Nav Session Badge --- */
.user-logged-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 7px 16px;
  border-radius: 9999px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}

.user-logged-badge:hover {
  background: rgba(255, 255, 255, 0.14);
  text-decoration: none;
}

.user-logged-badge .status-dot {
  width: 7px;
  height: 7px;
  background: #00a87e;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 168, 126, 0.8);
}

/* Form error state */
.form-error-alert {
  background: rgba(226, 59, 74, 0.14);
  border: 1px solid rgba(226, 59, 74, 0.35);
  color: #ff8591;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 18px;
  display: none;
  align-items: center;
  gap: 8px;
}

.form-error-alert.is-visible {
  display: flex;
}
