@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary-color: #6d28d9; /* Modern Violet */
  --primary-hover: #5b21b6;
  --secondary-color: #0f172a; /* Slate 900 */
  --accent-color: #f59e0b; /* Amber */
  --accent-hover: #d97706;
  --bg-color: #f8fafc; /* Slate 50 */
  --text-color: #334155; /* Slate 700 */
  --text-muted: #64748b; /* Slate 500 */
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 15px rgba(109, 40, 217, 0.4);
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--secondary-color);
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

h1 { font-size: 3rem; letter-spacing: -1px; }
h2 { font-size: 2.25rem; letter-spacing: -0.5px; }
h3 { font-size: 1.5rem; }

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

p {
  margin-bottom: 1rem;
}

/* Layout Utilities */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-padding {
  padding: 6rem 0;
}

.text-center { text-align: center !important; }
.text-muted { color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 9999px; /* Pill shape for SaaS look */
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: scale(0.96);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
  color: #fff;
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: #fff;
}

.btn-secondary:hover {
  background-color: #1e293b;
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  color: #fff;
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-block {
  width: 100%;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  opacity: 0;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.card:hover::before {
  opacity: 1;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--secondary-color);
}

/* Navbar */
.navbar {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  transition: var(--transition);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.logo {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--secondary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo-icon {
  color: var(--primary-color);
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(109, 40, 217, 0.3));
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
}

.nav-links li a {
  font-weight: 600;
  color: var(--text-color);
  font-size: 1rem;
  position: relative;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  width: 0; height: 2px;
  bottom: -4px; left: 0;
  background-color: var(--primary-color);
  transition: var(--transition);
}

.nav-links li a:hover {
  color: var(--primary-color);
}

.nav-links li a:hover::after, .nav-links li a.active::after {
  width: 100%;
}

.profile-menu {
  position: relative;
}

.profile-toggle {
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-color);
  border-radius: 999px;
  padding: 0.35rem 1rem 0.35rem 0.35rem; /* Tighter padding on left to accommodate avatar */
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.profile-toggle:hover {
  background: #f8fafc;
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.1);
}

.profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.8);
  transition: transform 0.2s ease;
}

.profile-avatar:hover {
  transform: scale(1.05);
}

/* Nav Cart Styles */
.nav-cart-item {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
}

.nav-cart-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(15, 118, 110, 0.08);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.nav-cart-btn:hover {
  background: rgba(15, 118, 110, 0.15);
  transform: translateY(-1px);
}

.cart-icon {
  font-size: 1.25rem;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: scale(0);
}

.cart-badge.visible {
  transform: scale(1);
}

.profile-toggle-icon {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-left: 0.2rem;
  transition: transform 0.2s ease;
}

.profile-dropdown.open ~ .profile-toggle .profile-toggle-icon {
  transform: rotate(180deg);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  display: none;
  overflow: hidden;
  z-index: 2100;
}

.profile-dropdown.open {
  display: block;
}

.profile-dropdown-link {
  display: block;
  padding: 0.7rem 0.9rem;
  color: var(--text-color);
  font-weight: 600;
}

.profile-dropdown-link:hover {
  background: #f8f4ff;
  color: var(--primary-color);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--secondary-color);
  cursor: pointer;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(109, 40, 217, 0.8) 100%), url('../assets/img/roof_waterproofing.png') center/cover no-repeat;
  color: #fff;
  text-align: center;
  padding: 12rem 1rem;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 100px;
  background: linear-gradient(to top, var(--bg-color), transparent);
}

.hero h1 {
  font-size: 4.5rem;
  color: #fff;
  margin-bottom: 1.5rem;
  letter-spacing: -1.5px;
  font-weight: 900;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero .highlight {
  color: var(--accent-color);
  position: relative;
  display: inline-block;
}

.hero p {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 3rem;
  color: #e2e8f0; /* slate 200 */
  font-weight: 400;
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  position: relative;
  z-index: 10;
}

/* Layout Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: var(--font-family);
  font-size: 1rem;
  color: var(--text-color);
  background-color: #fff;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.15);
}

.form-control:not(:placeholder-shown):valid {
  border-color: #10b981; /* Emerald 500 */
}

.form-control:not(:placeholder-shown):invalid {
  border-color: #ef4444; /* Red 500 */
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

/* Estimate Section */
.estimate-section {
  background:
    radial-gradient(circle at 10% 10%, rgba(109, 40, 217, 0.14), transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(245, 158, 11, 0.16), transparent 50%),
    linear-gradient(120deg, #f7f3ff 0%, #eff9ff 100%);
}

.estimate-container {
  max-width: 980px;
}

.estimate-shell {
  display: grid;
  grid-template-columns: 1.2fr 0.95fr;
  gap: 1.25rem;
  align-items: stretch;
  padding: 1.1rem;
  border-radius: 26px;
  border: 1px solid rgba(109, 40, 217, 0.14);
  background: rgba(255, 255, 255, 0.54);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 45px rgba(45, 22, 84, 0.08);
}

.estimate-form-card {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 32px rgba(51, 65, 85, 0.09);
}

.estimate-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.estimate-title {
  margin: 0 0 0.4rem;
  font-size: 2rem;
  line-height: 1.2;
}

.estimate-subtext {
  margin: 0;
  color: #51616b;
  font-size: 0.98rem;
}

.estimate-tag {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 0.4rem 0.78rem;
  background: rgba(109, 40, 217, 0.12);
  color: #5b21b6;
  font-size: 0.84rem;
  font-weight: 700;
}

.estimate-input {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.estimate-message {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(109, 40, 217, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: #5b21b6;
  font-weight: 600;
}

.estimate-error {
  display: block;
  margin-top: 0.35rem;
  color: #b42318;
  min-height: 1em;
}

.estimate-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.estimate-actions .btn {
  flex: 1 1 220px;
}

.estimate-result-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(109, 40, 217, 0.12);
  background: linear-gradient(165deg, rgba(109, 40, 217, 0.08), rgba(255, 255, 255, 0.94));
}

.estimate-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.estimate-summary-header h3 {
  margin: 0;
}

.estimate-summary-header span {
  color: #5b21b6;
  font-size: 0.9rem;
  font-weight: 700;
}

.estimate-summary-grid {
  display: grid;
  gap: 0.8rem;
}

.summary-chip {
  border: 1px solid rgba(109, 40, 217, 0.12);
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  background: rgba(255, 255, 255, 0.72);
}

.estimate-total-box {
  margin-top: 1rem;
  border: 1px solid rgba(109, 40, 217, 0.16);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  background: linear-gradient(120deg, rgba(109, 40, 217, 0.14), rgba(255, 255, 255, 0.95));
}

.estimate-total-label {
  color: #4a5964;
  font-weight: 600;
  font-size: 0.96rem;
  margin-bottom: 0.35rem;
}

.estimate-total-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1f1142;
  line-height: 1.1;
}

.estimate-total-box p {
  margin: 0.65rem 0 0;
  color: #51616b;
  font-size: 0.92rem;
}

/* Auth Pages Specific */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-color);
  padding: 2rem;
}

.auth-box {
  background: #fff;
  padding: 3.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  border-top: 4px solid var(--primary-color);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--secondary-color);
}

/* Product Cards */
.product-card {
  padding: 0;
  overflow: hidden;
  border-top: 4px solid var(--accent-color);
}

.product-card:hover {
  border-top-color: var(--primary-color);
}

.product-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  background-color: #f1f5f9;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.product-card:hover .product-img {
  transform: scale(1.05); /* subtle zoom */
}

.product-content {
  padding: 1.5rem;
}

/* Utilities */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 80px; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem 0;
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--border-color);
  }

  .nav-links.active { display: flex; }
  .menu-toggle { display: block; }

  .profile-dropdown {
    position: static;
    width: 100%;
    margin-top: 0.4rem;
  }

  .hero h1 { font-size: 3rem; }
  .hero-buttons { flex-direction: column; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .auth-box { padding: 2rem; }

  .estimate-shell {
    grid-template-columns: 1fr;
    padding: 0.8rem;
  }

  .estimate-title {
    font-size: 1.62rem;
  }

  .estimate-header {
    flex-direction: column;
  }
}

/* Footer */
footer {
  background-color: var(--secondary-color);
  color: #fff;
  padding: 6rem 0 2rem;
  margin-top: auto;
  border-top: 4px solid var(--primary-color);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 4rem;
}

.footer-col h3 {
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.75rem;
}

.footer-col h3::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 50px; height: 3px;
  background-color: var(--accent-color);
  border-radius: 3px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.875rem;
}

.footer-col ul li a {
  color: #B0BEC5;
  font-size: 0.95rem;
}

.footer-col ul li a:hover {
  color: #fff;
  padding-left: 5px;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #90A4AE;
  font-size: 0.875rem;
}
/* Cart Panel */
.cart-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  max-width: 100%;
  height: 100vh;
  background: #fff;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.cart-panel.open {
  right: 0;
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--secondary-color);
}

.cart-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--secondary-color);
}

.cart-items {
  padding: 1.5rem;
  flex-grow: 1;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.cart-item-info {
  flex-grow: 1;
}

.cart-item-title {
  font-weight: bold;
  color: var(--text-color);
}

.cart-item-price {
  color: var(--primary-color);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.qty-btn {
  background: #f0f0f0;
  border: none;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  border-radius: 4px;
}

.cart-item-remove {
  color: red;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: underline;
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  background: #f9f9f9;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--secondary-color);
}

.nav-cart-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  position: relative;
  color: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -10px;
  background: var(--primary-color);
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
}