:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f8fb;
  color: #111827;
  --sme-blue: #1b7ad1;
  --sme-sky: #52ccee;
  --sme-red: #ec4c4b;
  --sme-coral: #fe9f9f;
  --sme-teal: #349d9e;
  --sme-mint: #6dd895;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.hidden {
  display: none !important;
}

.min-h-screen {
  min-height: 100vh;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.mt-5 {
  margin-top: 20px;
}

.mt-6 {
  margin-top: 24px;
}

.px-5 {
  padding-left: 20px;
  padding-right: 20px;
}

.py-6 {
  padding-bottom: 24px;
  padding-top: 24px;
}

.p-4 {
  padding: 16px;
}

.p-5 {
  padding: 20px;
}

.max-w-xl {
  max-width: 576px;
}

.rounded-xl {
  border-radius: 16px;
}

.rounded-2xl {
  border-radius: 24px;
}

.bg-white {
  background: #fff;
}

.bg-emerald-50 {
  background: #eefbf7;
}

.bg-rose-50 {
  background: #fff1f2;
}

.bg-slate-50 {
  background: #f8fafc;
}

.bg-slate-100 {
  background: #f1f5f9;
}

.text-emerald-900 {
  color: #176b68;
}

.text-rose-900 {
  color: #881337;
}

.text-slate-700 {
  color: #334155;
}

.text-muted {
  color: #737382;
}

.text-xs {
  font-size: 12px;
}

.text-sm {
  font-size: 14px;
}

.text-lg {
  font-size: 18px;
}

.leading-7 {
  line-height: 1.55;
}

.shadow-card {
  box-shadow: 0 18px 40px rgba(27, 122, 209, 0.12);
}

.h-14 {
  height: 56px;
}

.h-16 {
  height: 64px;
}

.max-w-full {
  max-width: 100%;
}

.w-full {
  width: 100%;
}

.object-contain {
  object-fit: contain;
}

.object-left {
  object-position: left center;
}

.grid {
  display: grid;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gap-3 {
  gap: 12px;
}

.space-y-6 > * + * {
  margin-top: 24px;
}

.flex {
  display: flex;
}

.section-title {
  color: #111827;
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: #737382;
  font-size: 13px;
  font-weight: 700;
}

.field-row-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  align-items: center;
  gap: 12px;
  grid-column: 1 / -1;
}

.field-row-two-col span {
  color: #737382;
  font-size: 13px;
  font-weight: 700;
}

#expenses .expense-row:not(:first-child) span {
  display: none;
}

.field-help {
  color: #64748b;
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
  text-align: right;
}

.field-help.error {
  color: #be123c;
}

.field-help.ok {
  color: #047857;
}

input,
select,
textarea {
  appearance: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  color: #17171f;
  font: inherit;
  min-height: 48px;
  padding: 12px 14px;
  width: 100%;
}

input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  min-height: 0;
  min-width: 0;
  padding: 0;
  width: auto;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sme-blue);
  box-shadow: 0 0 0 3px rgba(82, 204, 238, 0.24);
  outline: 0;
}

input.input-error,
select.input-error,
textarea.input-error {
  border-color: #e11d48 !important;
}

input.input-error:focus,
select.input-error:focus,
textarea.input-error:focus {
  border-color: #e11d48 !important;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.24) !important;
  outline: 0;
}

input[readonly] {
  background: #f8fafc;
}

textarea {
  resize: vertical;
}

.description-field {
  margin-bottom: 10px;
}

.btn {
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  min-height: 54px;
  padding: 15px 18px;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--sme-blue), var(--sme-sky));
  color: #fff;
}

.btn-secondary {
  background: rgba(82, 204, 238, 0.16);
  color: #145f9e;
}

.btn:disabled {
  opacity: 0.55;
}

.whitespace-pre-wrap {
  white-space: pre-wrap;
  word-break: break-word;
}

.product-row {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 120px;
}

.expense-row {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 140px;
}

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

.forecast-summary {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 18px;
  color: #334155;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.forecast-metric {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-width: 0;
}

.forecast-metric span:first-child {
  color: #737382;
  font-size: 14px;
  font-weight: 700;
}

.forecast-metric span:last-child {
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  text-align: right;
}

.forecast-metric.net {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 10px;
}

.declaration {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 18px;
  color: #334155;
  cursor: pointer;
  display: flex;
  gap: 14px;
  padding: 16px;
}

.checkbox-shell {
  flex-shrink: 0;
  height: 28px;
  position: relative;
  width: 28px;
}

.checkbox-shell input {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  flex: 0 0 28px;
  height: 28px;
  margin: 0;
  min-height: 28px;
  min-width: 28px;
  padding: 0;
  width: 28px;
}

.checkbox-shell input:checked {
  background: linear-gradient(135deg, var(--sme-blue), var(--sme-sky));
  border-color: var(--sme-blue);
}

.checkbox-shell input:focus-visible {
  box-shadow: 0 0 0 4px rgba(82, 204, 238, 0.24);
  outline: 0;
}

.checkbox-mark {
  border: solid #fff;
  border-width: 0 3px 3px 0;
  height: 13px;
  left: 10px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 5px;
  transform: rotate(45deg);
  width: 7px;
}

.checkbox-shell input:checked + .checkbox-mark {
  opacity: 1;
}

.declaration-text {
  flex: 1;
  font-size: 16px;
  line-height: 1.45;
  min-width: 0;
}

.form-actions {
  display: grid;
  gap: 12px;
}

.turnstile-widget {
  border-radius: 14px;
  min-height: 65px;
  overflow: hidden;
  width: 100%;
}

.turnstile-widget iframe {
  display: block;
  max-width: 100%;
}

.success-screen {
  display: grid;
  gap: 18px;
  justify-items: center;
  padding: 32px 12px 12px;
  text-align: center;
}

.success-icon {
  align-items: center;
  background: linear-gradient(135deg, var(--sme-teal), var(--sme-mint));
  border-radius: 999px;
  color: #fff;
  display: flex;
  font-size: 34px;
  font-weight: 900;
  height: 72px;
  justify-content: center;
  width: 72px;
}

.success-screen h2 {
  color: #111827;
  font-size: 26px;
  font-weight: 800;
  margin: 0;
}

.success-screen p {
  color: #737382;
  font-size: 17px;
  line-height: 1.5;
  margin: 0;
}

.success-reference {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 18px;
  display: grid;
  gap: 8px;
  padding: 16px;
  width: 100%;
}

.success-reference span {
  color: #737382;
  font-size: 13px;
  font-weight: 700;
}

.success-reference strong {
  color: #111827;
  font-size: 16px;
  word-break: break-word;
}

@media (max-width: 420px) {
  .product-row,
  .expense-row {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 720px) {
  .finance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mock Wallet Styles */
.mock-wallet-container {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 1000;
}

.btn-wallet-connect {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid rgba(27, 122, 209, 0.3);
  border-radius: 12px;
  padding: 8px 14px;
  color: #1b7ad1;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(27, 122, 209, 0.06);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  height: 38px;
}

.btn-wallet-connect:hover {
  background: #1b7ad1;
  color: #ffffff;
  border-color: #1b7ad1;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(27, 122, 209, 0.15);
}

.btn-wallet-connect:active {
  transform: translateY(0);
}

.btn-wallet-connect.connected {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  cursor: default;
  transform: none;
}

.wallet-icon {
  width: 16px;
  height: 16px;
}

@media (max-width: 900px) {
  .mock-wallet-container {
    position: relative;
    top: 0;
    right: 0;
    margin: 0 auto 16px auto;
    max-width: 576px;
    padding: 0 20px;
    display: flex;
    justify-content: flex-end;
  }
  .btn-wallet-connect {
    width: auto;
  }
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.block {
  display: block;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Premium Drawer styles */
.declaration-link {
  color: var(--sme-blue);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 700;
  transition: color 0.2s ease;
}

.declaration-link:hover {
  color: var(--sme-sky);
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  justify-content: flex-end;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer-content {
  width: 100%;
  max-width: 550px;
  height: 100%;
  background: #ffffff;
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-overlay.active .drawer-content {
  transform: translateX(0);
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  margin: 0;
}

.drawer-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

.drawer-close:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.declaration-document {
  color: #374151;
  line-height: 1.6;
}

.declaration-document h1 {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
  margin-top: 0;
  margin-bottom: 20px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 12px;
}

.declaration-document h2 {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
  margin-top: 24px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.declaration-document .intro-text {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 16px;
}

.doc-list {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}

.doc-list > li {
  font-size: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: flex-start;
}

.doc-list > li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.doc-list > li strong {
  color: #111827;
  font-weight: 700;
  min-width: 45px;
  display: inline-block;
  flex-shrink: 0;
}

.doc-sublist {
  list-style-type: none;
  padding-left: 0;
  margin-top: 8px;
  width: 100%;
}

.doc-sublist li {
  font-size: 13.5px;
  color: #4b5563;
  margin-bottom: 8px;
  padding-left: 12px;
  border-left: 2px solid #e5e7eb;
}

.doc-sublist li strong {
  min-width: 55px;
}

.drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
}

@media (max-width: 600px) {
  .drawer-content {
    max-width: 100%;
    height: 90%;
    margin-top: auto;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  .drawer-overlay {
    align-items: flex-end;
  }
  .drawer-overlay.active .drawer-content {
    transform: translateY(0);
  }
}

/* Rejected Applications Carousel Styles */
.rejected-carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.rejected-carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  width: 100%;
  gap: 12px;
  padding: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Hide scrollbar Firefox */
}

.rejected-carousel-track::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome/Safari/Opera */
}

.rejected-card {
  flex: 0 0 100%;
  scroll-snap-align: start;
  background: linear-gradient(135deg, #ffffff 0%, #fffbfb 100%);
  border: 1px solid #fee2e2;
  border-radius: 12px;
  padding: 16px;
  box-sizing: border-box;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rejected-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.06);
}

.rejected-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #fee2e2;
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.rejected-ref-no {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

.rejected-status-badge {
  font-size: 11px;
  font-weight: 700;
  color: #b91c1c;
  background-color: #fef2f2;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  border: 1px solid #fca5a5;
  display: flex;
  align-items: center;
  gap: 4px;
}

.rejected-status-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #ef4444;
  border-radius: 50%;
}

.rejected-reason-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rejected-reason-text {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}

.rejected-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border: 1px solid #e2e8f0;
  color: #64748b;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.rejected-nav-btn:hover {
  background: #f8fafc;
  color: #1e293b;
  border-color: #cbd5e1;
}

.rejected-nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

#rejected-prev {
  left: -16px;
}

#rejected-next {
  right: -16px;
}

.rejected-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.rejected-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rejected-dot.active {
  background: #ef4444;
  width: 16px;
  border-radius: 4px;
}

@media (max-width: 640px) {
  /* On small screens, hide nav buttons and rely on touch swipe */
  .rejected-nav-btn {
    display: none !important;
  }
}

/* Loading Spinner Styles */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e2e8f0;
  border-top: 3px solid #1b7ad1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
