/* ============================================================
   CrafterProfit — Brand Overrides
   Bootstrap 5.3 handles layout, grid, spacing, and utilities.
   This file covers brand colors, fonts, and custom components.
   ============================================================ */

/* --- Custom Properties ------------------------------------- */
:root {
  --cp-green-dark:    #2d6a4f;
  --cp-green:         #40916c;
  --cp-green-mid:     #52b788;
  --cp-green-light:   #d8f3dc;

  --cp-earth:         #a07850;
  --cp-earth-light:   #e8ddd0;

  --cp-bg:            #faf9f7;
  --cp-surface:       #ffffff;
  --cp-surface-alt:   #f4f1ec;
  --cp-border:        #e4ddd6;

  --cp-text:          #2c2825;
  --cp-text-muted:    #7a7370;

  --cp-cta:           #e76f51;
  --cp-cta-hover:     #cf5c3f;

  --cp-font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --cp-font-display: 'Playfair Display', Georgia, serif;

  --cp-radius-md: 12px;
  --cp-radius-lg: 20px;
  --cp-radius-xl: 32px;

  --cp-shadow-card: 0 2px 12px rgba(44,40,37,.08);
  --cp-shadow-hover: 0 8px 28px rgba(44,40,37,.14);
}

/* --- Base -------------------------------------------------- */
html { scroll-behavior: smooth; }

body {
  font-family: var(--cp-font-sans);
  background-color: var(--cp-bg);
  color: var(--cp-text);
  -webkit-font-smoothing: antialiased;
}

/* Override Bootstrap's default link color in body copy */
a { color: inherit; }

/* --- Navbar ------------------------------------------------ */
.cp-navbar {
  background: rgba(250, 249, 247, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--cp-border);
}

.cp-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--cp-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cp-green-dark) !important;
  text-decoration: none;
}

.cp-brand-icon {
  width: 32px;
  height: 32px;
  background: var(--cp-green);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}

.cp-navbar .navbar-nav {
  gap: 0.5rem;
}

.cp-navbar .nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--cp-text-muted);
  transition: color 0.2s;
  padding: 0.5rem 0 !important;
}

.cp-navbar .nav-link:hover { 
  color: var(--cp-green-dark); 
}

/* Mobile menu styles */
.navbar-toggler {
  padding: 0.25rem 0.75rem;
  border: none;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(64, 145, 108, 0.25);
  outline: none;
}

.navbar-toggler:not(.collapsed) {
  background-color: transparent;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%232c2825' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  width: 1.5em;
  height: 1.5em;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Ensure mobile menu items stack vertically */
@media (max-width: 991.98px) {
  .navbar-collapse {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.99);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--cp-border);
    margin-top: 0;
    padding: 1rem;
    z-index: 999;
    max-height: calc(100vh - 60px);
    overflow-y: scroll;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .navbar-collapse::-webkit-scrollbar {
    display: none;
  }

  .navbar-nav {
    flex-direction: column;
    margin-bottom: 1rem;
  }

  .nav-link {
    padding: 0.75rem 0 !important;
  }

  .navbar-collapse .d-flex {
    flex-direction: column;
    width: 100%;
  }

  .navbar-collapse .btn {
    width: 100%;
  }
}

/* --- Buttons ----------------------------------------------- */
.btn-cp-primary {
  background: var(--cp-cta);
  color: #fff;
  border: 2px solid transparent;
  font-weight: 600;
  border-radius: var(--cp-radius-md);
  box-shadow: 0 4px 20px rgba(231,111,81,.35);
  transition: background .2s, box-shadow .2s, transform .15s;
}
.btn-cp-primary:hover {
  background: var(--cp-cta-hover);
  color: #fff;
  box-shadow: 0 6px 24px rgba(231,111,81,.45);
}
.btn-cp-primary:active { transform: translateY(1px); }

.btn-cp-outline {
  background: transparent;
  color: var(--cp-text);
  border: 2px solid var(--cp-border);
  font-weight: 600;
  border-radius: var(--cp-radius-md);
  transition: border-color .2s, color .2s, background .2s;
}
.btn-cp-outline:hover {
  border-color: var(--cp-green);
  color: var(--cp-green-dark);
  background: var(--cp-green-light);
}

.btn-cp-ghost {
  background: transparent;
  color: var(--cp-text-muted);
  border: 2px solid transparent;
  font-weight: 500;
  border-radius: var(--cp-radius-md);
  transition: color .2s;
}
.btn-cp-ghost:hover { color: var(--cp-text); }

.btn-cp-cta-white {
  background: #fff;
  color: var(--cp-green-dark);
  border: 2px solid transparent;
  font-weight: 700;
  border-radius: var(--cp-radius-lg);
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  transition: background .2s, box-shadow .2s;
}
.btn-cp-cta-white:hover {
  background: #f0faf3;
  color: var(--cp-green-dark);
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
}

.btn-cp-cta-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,.4);
  font-weight: 600;
  border-radius: var(--cp-radius-lg);
  transition: background .2s, border-color .2s;
}
.btn-cp-cta-outline:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-color: rgba(255,255,255,.7);
}

/* --- Badge ------------------------------------------------- */
.cp-badge {
  display: inline-block;
  background: var(--cp-green-light);
  color: var(--cp-green-dark);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3em 0.9em;
  border-radius: 100px;
}

.cp-badge-light {
  background: rgba(255,255,255,.12);
  color: #b7e4c7;
}

/* --- Sections ---------------------------------------------- */
.cp-section {
  padding-block: 5rem;
}

.cp-section-alt {
  background-color: var(--cp-surface-alt);
}

.cp-section-heading {
  font-family: var(--cp-font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--cp-text);
  text-align: center;
}

.cp-section-sub {
  font-size: 1.05rem;
  color: var(--cp-text-muted);
  text-align: center;
  max-width: 540px;
  margin-inline: auto;
}

/* --- Hero -------------------------------------------------- */
.cp-hero {
  overflow: hidden;
}

.cp-headline {
  font-family: var(--cp-font-display);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--cp-text);
}
.cp-headline em {
  font-style: normal;
  color: var(--cp-green);
}

.cp-subheadline {
  font-size: 1.15rem;
  color: var(--cp-text-muted);
  line-height: 1.7;
  max-width: 460px;
}

.cp-stars { color: #f4a261; letter-spacing: -2px; }

.cp-hero-content { animation: cp-fadeUp .6s ease both; }
.cp-hero-visual  { animation: cp-fadeUp .6s .12s ease both; }

@keyframes cp-fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Dashboard Mockup -------------------------------------- */
.dashboard-mockup {
  background: var(--cp-surface);
  border-radius: var(--cp-radius-xl);
  box-shadow: 0 20px 60px rgba(44,40,37,.18);
  padding: 1.25rem;
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--cp-border);
}

.mockup__floating-badge {
  position: absolute;
  top: -14px;
  right: -14px;
  background: var(--cp-green);
  color: #fff;
  border-radius: var(--cp-radius-md);
  padding: 0.5rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(64,145,108,.4);
  white-space: nowrap;
  z-index: 1;
}

.mockup__titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--cp-border);
}

.mockup__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mockup__dot--red   { background: #ff6059; }
.mockup__dot--amber { background: #ffbd2e; }
.mockup__dot--green { background: #28c840; }

.mockup__tab-label {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cp-text-muted);
  letter-spacing: 0.04em;
}

.mockup__stat {
  background: var(--cp-surface-alt);
  border-radius: var(--cp-radius-md);
  padding: 0.65rem 0.5rem;
  text-align: center;
}
.mockup__stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cp-text);
  line-height: 1;
  margin-bottom: 2px;
}
.mockup__stat-value--green { color: var(--cp-green); }
.mockup__stat-value--earth { color: var(--cp-earth); }
.mockup__stat-label {
  font-size: 0.62rem;
  color: var(--cp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mockup__chart {
  background: var(--cp-surface-alt);
  border-radius: var(--cp-radius-md);
  padding: 0.75rem;
}
.mockup__chart-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cp-text-muted);
  margin-bottom: 0.5rem;
}
.mockup__bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 70px;
}
.mockup__bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
}
.mockup__bar--revenue { background: var(--cp-earth-light); }
.mockup__bar--profit  { background: var(--cp-green); }

.mockup__order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  font-size: 0.76rem;
  transition: background .15s;
}
.mockup__order-row:hover { background: var(--cp-surface-alt); }
.mockup__order-name   { font-weight: 600; color: var(--cp-text); flex: 1; }
.mockup__order-fee    { color: var(--cp-earth); font-weight: 500; margin-right: 0.5rem; }
.mockup__order-profit { color: var(--cp-green); font-weight: 700; }

/* --- Cards ------------------------------------------------- */
.cp-card {
  background: var(--cp-surface);
  border-radius: var(--cp-radius-lg);
  padding: 2rem 1.5rem;
  box-shadow: var(--cp-shadow-card);
  border: 1px solid var(--cp-border);
  transition: box-shadow .2s, transform .2s;
}
.cp-card:hover {
  box-shadow: var(--cp-shadow-hover);
  transform: translateY(-3px);
}

.cp-card-icon { font-size: 2rem; margin-bottom: 0.75rem; line-height: 1; }

.cp-problem-number {
  font-family: var(--cp-font-display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.cp-number--green { color: var(--cp-green); }
.cp-number--earth { color: var(--cp-earth); }
.cp-number--red   { color: #e63946; }

.cp-punchline {
  font-family: var(--cp-font-display);
  font-size: 1.5rem;
  color: var(--cp-text-muted);
  font-style: italic;
}

/* --- Steps ------------------------------------------------- */
.cp-steps {
  position: relative;
}

.cp-steps::before {
  content: '';
  position: absolute;
  top: 40px;
  left: calc(16.666% + 20px);
  right: calc(16.666% + 20px);
  height: 2px;
  background: linear-gradient(to right, var(--cp-green-light), var(--cp-green), var(--cp-green-light));
  z-index: 0;
}

@media (max-width: 767px) {
  .cp-steps::before { display: none; }
}

.cp-step { position: relative; z-index: 1; }

.cp-step-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--cp-surface);
  border: 3px solid var(--cp-green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: var(--cp-shadow-card);
  position: relative;
  transition: border-color .2s, box-shadow .2s;
}
.cp-step:hover .cp-step-icon-wrap {
  border-color: var(--cp-green);
  box-shadow: 0 0 0 6px var(--cp-green-light);
}

.cp-step-number {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 22px;
  height: 22px;
  background: var(--cp-green);
  color: #fff;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--cp-bg);
}

/* --- Feature cards ----------------------------------------- */
.cp-feature-card { padding: 1.5rem; }

.cp-feature-icon {
  width: 48px;
  height: 48px;
  background: var(--cp-green-light);
  border-radius: var(--cp-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* --- Reality Breakdown ------------------------------------- */
.cp-breakdown {
  background: var(--cp-surface);
  border-radius: var(--cp-radius-xl);
  box-shadow: var(--cp-shadow-hover);
  border: 1px solid var(--cp-border);
  overflow: hidden;
}

.cp-breakdown-item {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--cp-border);
  transition: background .15s;
}
.cp-breakdown-item:last-child { border-bottom: none; }
.cp-breakdown-item:hover { background: var(--cp-surface-alt); }

.cp-breakdown-final {
  background: var(--cp-green-light);
  border-top: 2px solid var(--cp-green);
}
.cp-breakdown-final:hover { background: #c7ead2; }

.cp-breakdown-icon { font-size: 1.2rem; }
.cp-breakdown-label { font-size: 0.9rem; font-weight: 500; color: var(--cp-text-muted); }
.cp-breakdown-final .cp-breakdown-label { font-weight: 700; color: var(--cp-green-dark); font-size: 1rem; }

.cp-breakdown-amount { font-size: 1.1rem; font-weight: 700; }
.cp-amount-positive { color: var(--cp-green); }
.cp-amount-deduct   { color: var(--cp-earth); }
.cp-amount-final    { color: var(--cp-green-dark); font-size: 1.3rem; }

.cp-breakdown-delta {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--cp-earth);
}

/* --- CTA --------------------------------------------------- */
.cp-cta {
  background: linear-gradient(135deg, var(--cp-green-dark) 0%, #1b4332 100%);
  position: relative;
  overflow: hidden;
}
.cp-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='20' fill='%23ffffff' fill-opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
}

.cp-cta-heading {
  font-family: var(--cp-font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.cp-cta-sub  { font-size: 1.1rem; color: rgba(255,255,255,.72); }
.cp-cta-note { font-size: 0.82rem; color: rgba(255,255,255,.45); }

/* --- Footer ------------------------------------------------ */
.cp-footer {
  background: var(--cp-surface);
  border-top: 1px solid var(--cp-border);
  padding-block: 1.75rem;
}

.cp-footer-logo {
  font-family: var(--cp-font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cp-green-dark);
}

.cp-footer-link { font-size: 0.85rem; color: var(--cp-text-muted); text-decoration: none; transition: color .2s; }
.cp-footer-link:hover { color: var(--cp-green); }
.cp-footer-copy { font-size: 0.8rem; color: var(--cp-text-muted); }
