/* =========================================
   Ranchi Carpenters — Furniture Design Studio
   design.ranchicarpenters.com
   ========================================= */

:root {
  --brown-dark:   #78350F;
  --brown-mid:    #92400E;
  --brown-light:  #B45309;
  --amber:        #D97706;
  --amber-soft:   #FEF3C7;
  --amber-pale:   #FFFBEB;
  --blue:         #2563EB;
  --blue-soft:    #EFF6FF;
  --green:        #16A34A;
  --green-soft:   #F0FDF4;
  --text-primary: #1C1917;
  --text-muted:   #78716C;
  --text-light:   #A8A29E;
  --bg:           #FAFAF9;
  --surface:      #FFFFFF;
  --border:       #E7E5E4;
  --border-soft:  #F5F5F4;
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    14px;
  --radius-xl:    20px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.10);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- NAVBAR ---- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit;
}
.nav-icon { font-size: 26px; }
.nav-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--brown-dark); line-height: 1.2; }
.nav-sub   { font-size: 11px; color: var(--text-muted); }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { text-decoration: none; font-size: 14px; color: var(--text-muted); transition: color 0.15s; }
.nav-links a:hover { color: var(--brown-mid); }
.nav-cta {
  background: linear-gradient(135deg, var(--brown-dark), var(--brown-light));
  color: #fff !important; padding: 8px 16px;
  border-radius: var(--radius-md); font-weight: 500 !important;
  font-size: 13px !important; transition: opacity 0.15s !important;
}
.nav-cta:hover { opacity: 0.88; }

/* ---- HERO ---- */
.hero {
  background: linear-gradient(160deg, #78350F 0%, #92400E 40%, #B45309 100%);
  padding: 4rem 1.5rem 3.5rem;
  text-align: center; position: relative; overflow: hidden;
}
.hero::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%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-inner { max-width: 680px; margin: 0 auto; position: relative; }
.hero-badge {
  display: inline-block; background: rgba(255,255,255,0.18);
  color: #FEF3C7; font-size: 12px; font-weight: 500;
  padding: 5px 14px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.25); margin-bottom: 1.25rem;
  letter-spacing: 0.04em;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600; color: #FEF3C7;
  line-height: 1.2; margin-bottom: 1rem;
}
.hero-sub {
  font-size: 16px; color: rgba(254,243,199,0.85);
  max-width: 520px; margin: 0 auto 2rem; line-height: 1.7;
}
.hero-stats {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-n { display: block; font-size: 20px; font-weight: 600; color: #FEF3C7; }
.stat-l { display: block; font-size: 12px; color: rgba(254,243,199,0.7); }
.stat-div { width: 1px; height: 36px; background: rgba(255,255,255,0.2); }

/* ---- MAIN CONTAINER ---- */
.container { max-width: 900px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }

/* ---- TABS ---- */
.tabs-wrapper { margin-bottom: 1.75rem; }
.tabs {
  display: flex; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 5px;
  box-shadow: var(--shadow-sm);
}
.tab {
  flex: 1; padding: 0.6rem 0.75rem; border: none; background: none;
  border-radius: var(--radius-lg); font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer; transition: all 0.18s;
  white-space: nowrap;
}
.tab:hover:not(.active) { background: var(--border-soft); color: var(--text-primary); }
.tab.active {
  background: linear-gradient(135deg, var(--brown-dark), var(--brown-light));
  color: #FEF3C7; box-shadow: var(--shadow-sm);
}
@media(max-width:500px){ .tab { font-size: 12px; padding: 0.55rem 0.5rem; } }

/* ---- TAB PANELS ---- */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- CARDS ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.form-card { margin-bottom: 1.5rem; }
.card-header {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(135deg, #FAFAF9, #FFFBEB);
}
.card-header h2 {
  font-family: var(--font-display); font-size: 20px; font-weight: 600;
  color: var(--brown-dark); margin-bottom: 3px;
}
.card-header p { font-size: 13px; color: var(--text-muted); }
.form-body { padding: 1.5rem; }

/* ---- FORM ELEMENTS ---- */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem; margin-bottom: 1rem;
}
@media(max-width:560px){ .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 1rem; }
.field.full { grid-column: 1 / -1; }
.field:last-child { margin-bottom: 0; }

label {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
}
input, select, textarea {
  width: 100%; padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md); font-size: 14px;
  font-family: var(--font-body); color: var(--text-primary);
  background: #FAFAF9; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--amber); background: #fff;
  box-shadow: 0 0 0 3px rgba(217,119,6,0.1);
}
textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

/* ---- CHIPS ---- */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.chip {
  font-size: 12px; padding: 4px 13px;
  border: 1px solid var(--border); border-radius: 20px;
  cursor: pointer; color: var(--text-muted);
  background: var(--surface); transition: all 0.15s;
}
.chip:hover { border-color: var(--amber); color: var(--brown-mid); background: var(--amber-pale); }

/* ---- BUTTONS ---- */
.btn-group { display: flex; gap: 10px; margin-top: 1.25rem; flex-wrap: wrap; }
.btn {
  flex: 1; min-width: 180px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0.75rem 1.25rem; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.15s; font-family: var(--font-body);
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--brown-dark), var(--brown-light));
  color: #FEF3C7; box-shadow: 0 3px 12px rgba(120,53,15,0.25);
}
.btn-primary:hover { opacity: 0.9; box-shadow: 0 5px 16px rgba(120,53,15,0.3); }
.btn-accent {
  background: linear-gradient(135deg, #1D4ED8, var(--blue));
  color: #fff; box-shadow: 0 3px 12px rgba(37,99,235,0.2);
}
.btn-accent:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---- LOADING ---- */
.loading-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2.5rem;
  text-align: center; margin-bottom: 1.5rem;
}
.loading-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--brown-mid);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-inner p { font-size: 14px; color: var(--text-muted); }

/* ---- RESULT CARD ---- */
.result-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-md); margin-bottom: 1.5rem;
}
.result-header {
  background: linear-gradient(135deg, var(--brown-dark), var(--brown-mid));
  padding: 1.1rem 1.5rem;
  display: flex; align-items: center; gap: 12px;
}
.result-header-icon { font-size: 24px; }
.result-header-text h2 { font-size: 17px; font-weight: 600; color: #FEF3C7; }
.result-header-text p { font-size: 12px; color: rgba(254,243,199,0.75); margin-top: 2px; }
.result-body { padding: 0; }

.result-section {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-soft);
}
.result-section:last-child { border-bottom: none; }
.section-label {
  font-size: 11px; font-weight: 600; color: var(--brown-light);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.6rem;
}
.section-text { font-size: 14px; color: var(--text-primary); line-height: 1.75; }

/* dimensions grid */
.dim-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px,1fr)); gap: 8px; }
.dim-card {
  background: var(--amber-pale); border: 1px solid #FDE68A;
  border-radius: var(--radius-md); padding: 0.6rem 0.75rem; text-align: center;
}
.dim-val { font-size: 15px; font-weight: 600; color: var(--brown-dark); }
.dim-lbl { font-size: 11px; color: var(--brown-light); margin-top: 2px; }

/* materials */
.mat-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 0.5rem; }
.mat-tag {
  display: inline-block; background: var(--border-soft);
  border: 1px solid var(--border); color: var(--text-muted);
  font-size: 12px; padding: 4px 12px; border-radius: 20px;
}

/* cost badge */
.cost-badge {
  display: inline-block;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 1px solid #D97706; color: var(--brown-dark);
  font-size: 20px; font-weight: 700; padding: 0.5rem 1.25rem;
  border-radius: var(--radius-md); margin-bottom: 0.5rem;
  font-family: var(--font-display);
}
.cost-note { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* suggestions */
.suggestion-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.suggestion-list li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; color: var(--text-primary); line-height: 1.6;
}
.suggestion-list li::before {
  content: '✦'; color: var(--amber); font-size: 12px; margin-top: 3px; flex-shrink: 0;
}

/* feasibility */
.feasibility-box {
  background: var(--green-soft); border: 1px solid #BBF7D0;
  border-radius: var(--radius-md); padding: 0.85rem 1rem;
  border-left: 4px solid var(--green);
  display: flex; align-items: flex-start; gap: 10px;
}
.feasibility-box .feas-icon { font-size: 20px; flex-shrink: 0; }
.feasibility-box p { font-size: 14px; color: #166534; line-height: 1.6; }

/* ---- IMAGE GRID ---- */
.img-section-header {
  background: linear-gradient(135deg, #1e3a5f, var(--blue));
  padding: 0.85rem 1.25rem;
  display: flex; align-items: center; gap: 10px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.img-section-header h3 { font-size: 15px; font-weight: 600; color: #DBEAFE; }
.img-section-header p  { font-size: 12px; color: rgba(219,234,254,0.7); }
.img-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 1.25rem; }
@media(max-width:480px){ .img-grid { grid-template-columns: 1fr; } }
.img-card {
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border); background: var(--border-soft);
}
.img-card img { width: 100%; height: 230px; object-fit: cover; display: block; cursor: zoom-in; transition: transform 0.2s; }
.img-card img:hover { transform: scale(1.02); }
.img-card-label { font-size: 11px; color: var(--text-light); padding: 6px 10px; text-align: center; }
.img-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 230px; gap: 10px;
}
.img-spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.img-loading p { font-size: 12px; color: var(--text-muted); }
.img-error { display: flex; align-items: center; justify-content: center; height: 120px; font-size: 12px; color: #991B1B; padding: 1rem; text-align: center; }
.regen-row { padding: 0 1.25rem 1.25rem; }
.regen-btn {
  width: 100%; padding: 0.55rem; border-radius: var(--radius-md);
  font-size: 13px; cursor: pointer;
  border: 1px solid var(--border); background: var(--border-soft);
  color: var(--text-muted); font-family: var(--font-body);
  transition: all 0.15s;
}
.regen-btn:hover { border-color: var(--blue); color: var(--blue); }

/* ---- FOOTER ---- */
.footer {
  background: var(--brown-dark); padding: 2.5rem 1.5rem;
}
.footer-inner { max-width: 900px; margin: 0 auto; }
.footer-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 1.25rem;
  font-size: 24px;
}
.footer-name { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: #FEF3C7; }
.footer-tagline { font-size: 12px; color: rgba(254,243,199,0.6); }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.footer-links a { font-size: 13px; color: rgba(254,243,199,0.7); text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: #FEF3C7; }
.footer-note { font-size: 12px; color: rgba(254,243,199,0.45); line-height: 1.6; max-width: 600px; }

/* ---- RESPONSIVE ---- */
@media(max-width:600px){
  .hero { padding: 3rem 1rem 2.5rem; }
  .container { padding: 1.5rem 1rem 3rem; }
  .btn-group { flex-direction: column; }
  .btn { min-width: unset; }
  .nav-links a:not(.nav-cta) { display: none; }
}
