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

:root {
  --brand: #DC6803;
  --brand-hover: #B45309;
  --brand-light: #FFFAEB;
  --brand-border: #F79009;
  --brand-text: #B54708;
  --green: #079455;
  --red: #D92D20;
  --text-primary: #171717;
  --text-secondary: #404040;
  --text-tertiary: #525252;
  --text-muted: #737373;
  --border: #E5E5E5;
  --border-input: #D4D4D4;
  --bg-main: #F5F5F5;
  --bg-white: #ffffff;
  --bg-secondary: #FAFAFA;
  --shadow-xs: 0px 1px 2px rgba(10,13,18,0.05);
  --shadow-card: 0px 12px 40px rgba(0,0,0,0.06);
  --shadow-soft: 0px 12px 40px -12px rgba(0,0,0,0.06);
  --radius: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
}

/* ====== HEADER ====== */
.header {
  position: sticky; top: 0; z-index: 100;
  height: 56px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  border-top: 2px solid var(--brand);
  padding: 12px;
  display: flex; align-items: center;
}
.logo-row { display: flex; align-items: center; gap: 12px; height: 32px; }
.logo-icon { width: 32px; height: 32px; flex-shrink: 0; }
.logo-text { font-size: 20px; font-weight: 700; color: #7A2E0E; white-space: nowrap; }

/* ====== BODY ====== */
.body-wrap {
  padding: 20px;
  display: flex; justify-content: center;
}
.center-container {
  width: 100%; max-width: 1024px;
  display: flex; flex-direction: column; gap: 0;
}

.btn-primary-brand {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: var(--radius); border: none;
  background: var(--brand); color: white;
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}
.btn-primary-brand:hover { background: var(--brand-hover); }
.btn-primary-brand img { width: 20px; height: 20px; }
.btn-secondary {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: var(--radius);
  border: 1px solid var(--border-input); background: white;
  font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--text-secondary); cursor: pointer; transition: background 0.15s;
}
.btn-secondary:hover { background: #F5F5F5; }
.btn-secondary img { width: 20px; height: 20px; }

.badge-active {
  background: #ECFDF3; border: 1px solid #ABEFC6;
  border-radius: 9999px; padding: 1px 8px;
  font-size: 12px; font-weight: 500; color: #067647;
  white-space: nowrap;
}
.badge-closed {
  background: #FEF3F2; border: 1px solid #FECDCA;
  border-radius: 9999px; padding: 1px 8px;
  font-size: 12px; font-weight: 500; color: #B42318;
  white-space: nowrap;
}

.btn-loan-primary {
  flex: 1; padding: 7px 10px; border-radius: var(--radius);
  border: 2px solid rgba(255,255,255,0.12); background: var(--brand);
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
  color: white; cursor: pointer; text-align: center;
  transition: background 0.15s;
}
.btn-loan-primary:hover { background: var(--brand-hover); }
.btn-loan-secondary {
  flex: 1; padding: 7px 10px; border-radius: var(--radius);
  border: 1px solid var(--border-input); background: white;
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); cursor: pointer; text-align: center;
  transition: background 0.15s;
}
.btn-loan-secondary:hover { background: #F5F5F5; }

/* ====== CONTACT & CONDITION MODALS ====== */
.cmodal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.cmodal-overlay.open { display: flex; }
@keyframes cmodal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.cmodal-box {
  background: white;
  border-radius: 16px;
  box-shadow: 0px 20px 24px -4px rgba(10,13,18,0.08), 0px 8px 8px -4px rgba(10,13,18,0.03);
  width: 100%; max-width: 480px;
  position: relative;
  animation: cmodal-in 0.2s ease;
  overflow: hidden;
}
.cmodal-body {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 32px 24px;
  text-align: center;
}
/* Featured icon ring */
.cmodal-icon-wrap {
  position: relative; width: 56px; height: 56px; flex-shrink: 0;
}
.cmodal-icon-ring {
  position: absolute; inset: 0;
  border-radius: 28px;
  background: #FEF0C7;
  border: 8px solid #FFFAEB;
}
.cmodal-icon-inner {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 36px; height: 36px; border-radius: 99px;
  background: #DC6803;
  display: flex; align-items: center; justify-content: center;
}
.cmodal-icon-inner svg { flex-shrink: 0; }
/* Text block */
.cmodal-texts { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.cmodal-title { font-size: 18px; font-weight: 600; color: #171717; line-height: 28px; }
.cmodal-desc { font-size: 14px; font-weight: 400; color: #525252; line-height: 20px; }
.cmodal-desc strong { font-weight: 600; color: #171717; }
/* Badge */
.cmodal-badge {
  display: inline-flex; align-items: center;
  padding: 1px 8px;
  background: #ECFDF3; border: 1px solid #ABEFC6; border-radius: 9999px;
  font-size: 12px; font-weight: 500; color: #067647; line-height: 18px;
}
/* Input */
.cmodal-input-wrap { width: 100%; }
.cmodal-input {
  width: 100%; box-sizing: border-box;
  border: 1px solid #D4D4D4; border-radius: 8px;
  padding: 8px 12px;
  display: flex; align-items: center; gap: 8px;
  background: white;
  box-shadow: 0px 1px 2px rgba(10,13,18,0.05);
}
.cmodal-input input {
  border: none; outline: none; background: transparent;
  font-size: 16px; font-weight: 400; color: #171717;
  flex: 1; min-width: 0;
  font-family: 'Inter', sans-serif;
}
.cmodal-input input::placeholder { color: #737373; }
/* CTA button */
.cmodal-cta {
  width: 100%; padding: 10px 14px;
  background: #DC6803;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  box-shadow: none;
  color: white; font-size: 15px; font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
}
.cmodal-cta:hover { background: #B45309; }
/* Close button */
.cmodal-close {
  position: absolute; top: 8px; right: 8px;
  width: 40px; height: 40px;
  border: none; background: none; cursor: pointer;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.cmodal-close:hover { background: #F5F5F5; }

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
@keyframes fadeIn {
  from { opacity:0; transform:translateX(-50%) translateY(8px); }
  to   { opacity:1; transform:translateX(-50%) translateY(0); }
}

@media (max-width: 768px) {
/* ---- Header ---- */
  .header {
    border-top: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    height: auto;
    justify-content: space-between;
  }
  /* Ẩn logo desktop, thay bằng back + buttons */
  .header .logo-row { display: none; }
  .header-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .header-mobile-back {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; cursor: pointer;
    color: var(--text-primary); flex-shrink: 0;
    background: none; border: none; padding: 0;
  }
  .header-mobile-actions { display: flex; gap: 8px; align-items: center; }
  .header-mobile-btn {
    display: flex; align-items: center; justify-content: center;
    padding: 6px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
  }
  .header-mobile-cta {
    display: flex; align-items: center; gap: 4px;
    padding: 7px 10px;
    background: #DC6803;
    color: white;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    font-family: 'Inter', sans-serif;
    font-size: 12px; font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    white-space: nowrap;
  }
}
