/* CO2 Calculator - multiplye.ai Corporate Design */

/* Import Rubik Font */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500&display=swap');

/* Brand Colors from Corporate Design */
:root {
  /* Primary Colors */
  --turquoise: #009999;
  --petrol: #367997;
  --coral: #ff9999;
  
  /* Content Colors */
  --white: #ffffff;
  --black: #121212;
  --electric-blue: #1e6bf2;
  
  /* UI Colors (derived) */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Gradients */
  --brand-gradient: linear-gradient(135deg, var(--turquoise) 0%, var(--petrol) 100%);
  --accent-gradient: linear-gradient(135deg, var(--coral) 0%, #ff7777 100%);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  color: var(--black);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* Container */
.calculator-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(54, 121, 151, 0.15);
}

/* Header */
.calculator-header {
  background: var(--brand-gradient);
  color: var(--white);
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* X Pattern Background (from multiplye cards) */
.calculator-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: var(--coral);
  clip-path: polygon(20% 0%, 0% 20%, 30% 50%, 0% 80%, 20% 100%, 50% 70%, 80% 100%, 100% 80%, 70% 50%, 100% 20%, 80% 0%, 50% 30%);
  opacity: 0.2;
  transform: scale(3);
}

.calculator-title {
  font-size: 2.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.calculator-subtitle {
  font-size: 1.25rem;
  font-weight: 300;
  opacity: 0.95;
  position: relative;
  z-index: 1;
}

/* Progress Bar */
.progress-bar {
  height: 4px;
  background: var(--gray-200);
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--coral);
  transition: width 0.3s ease;
}

/* Form */
.form-container {
  padding: 3rem 2rem;
}

.form-group {
  margin-bottom: 2rem;
}

.form-label {
  display: block;
  font-weight: 400;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: var(--black);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-select {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Rubik', sans-serif;
  font-weight: 300;
  transition: all 0.2s ease;
  background: var(--white);
  color: var(--black);
}

.form-input:hover,
.form-select:hover {
  border-color: var(--gray-300);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--turquoise);
  box-shadow: 0 0 0 4px rgba(0, 153, 153, 0.1);
}

.form-input::placeholder {
  color: var(--gray-400);
  font-weight: 300;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Buttons */
.btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 400;
  font-family: 'Rubik', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-primary {
  background: var(--coral);
  color: var(--white);
  width: 100%;
  box-shadow: 0 4px 12px -2px rgba(255, 153, 153, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(255, 153, 153, 0.5);
}

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

.btn-secondary {
  background: transparent;
  color: var(--turquoise);
  border: 2px solid var(--turquoise);
}

.btn-secondary:hover {
  background: var(--turquoise);
  color: var(--white);
}

/* Results */
.results-container {
  padding: 3rem 2rem;
  background: var(--gray-50);
  text-align: center;
}

.co2-total {
  font-size: 4.5rem;
  font-weight: 500;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.co2-unit {
  font-size: 1.25rem;
  color: var(--gray-600);
  margin-bottom: 3rem;
  font-weight: 300;
}

/* Breakdown */
.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.breakdown-item {
  background: var(--white);
  padding: 2rem 1.5rem;
  border-radius: 16px;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.breakdown-item:hover {
  border-color: var(--turquoise);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(0, 153, 153, 0.2);
}

.breakdown-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.breakdown-value {
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--petrol);
}

/* Comparisons */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.comparison-item {
  text-align: center;
}

.comparison-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  display: block;
  filter: grayscale(20%);
}

.comparison-text {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 300;
}

/* Email Capture - Card Style */
.email-capture {
  margin-top: 3rem;
  padding: 3rem;
  background: var(--electric-blue);
  border-radius: 20px;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

/* X Pattern for email section */
.email-capture::before {
  content: '';
  position: absolute;
  top: -30%;
  left: -10%;
  width: 150px;
  height: 150px;
  background: var(--coral);
  clip-path: polygon(20% 0%, 0% 20%, 30% 50%, 0% 80%, 20% 100%, 50% 70%, 80% 100%, 100% 80%, 70% 50%, 100% 20%, 80% 0%, 50% 30%);
  opacity: 0.1;
  transform: scale(2) rotate(45deg);
}

.email-capture h3 {
  font-size: 1.75rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.email-capture p {
  margin-bottom: 2rem;
  opacity: 0.95;
  font-weight: 300;
  position: relative;
  z-index: 1;
}

.email-form {
  display: flex;
  gap: 1rem;
  max-width: 450px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.email-input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  font-size: 1rem;
  font-family: 'Rubik', sans-serif;
  font-weight: 300;
  transition: all 0.2s ease;
}

.email-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.email-input:focus {
  outline: none;
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.2);
}

.email-form .btn-primary {
  width: auto;
  padding: 1rem 2.5rem;
  background: var(--coral);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.2);
}

/* Success Message */
.success-message {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  font-weight: 400;
  display: inline-block;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 4rem 2rem;
}

.spinner {
  display: inline-block;
  width: 48px;
  height: 48px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--turquoise);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .calculator-container {
    border-radius: 0;
  }
  
  .calculator-header {
    padding: 2.5rem 1.5rem;
  }
  
  .calculator-title {
    font-size: 2rem;
  }
  
  .form-container,
  .results-container {
    padding: 2rem 1.5rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .email-form {
    flex-direction: column;
  }
  
  .email-form .btn-primary {
    width: 100%;
  }
  
  .co2-total {
    font-size: 3.5rem;
  }
  
  .comparison-grid {
    grid-template-columns: 1fr;
  }
  
  .breakdown-grid {
    grid-template-columns: 1fr;
  }
}

/* Hover States */
@media (hover: hover) {
  .form-input:hover,
  .form-select:hover {
    background: var(--gray-50);
  }
}

/* Focus Visible */
*:focus-visible {
  outline: 2px solid var(--turquoise);
  outline-offset: 2px;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-group {
  animation: fadeIn 0.5s ease-out;
  animation-fill-mode: both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.15s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }
.form-group:nth-child(4) { animation-delay: 0.25s; }

/* Print Styles */
@media print {
  .calculator-header {
    background: none;
    color: var(--black);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .btn,
  .email-capture {
    display: none;
  }
}
