/* ============================================================
   MEETING COST CALCULATOR — Design System
   Palette: Copper & Slate (premium SaaS / fintech)
   Fonts: Playfair Display (display) + DM Sans (body)
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --copper:        #B87333;
  --copper-light:  #D4A574;
  --copper-pale:   #F0E0CC;
  --slate-dark:    #2F3640;
  --slate-mid:     #3D4A56;
  --slate-light:   #6B7A8D;
  --cream:         #F5F0EB;
  --cream-dark:    #EDE5DA;
  --white:         #FDFAF7;
  --text-primary:  #1E2530;
  --text-secondary:#4A5568;
  --text-muted:    #8A96A3;

  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'DM Sans', system-ui, sans-serif;

  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     20px;
  --radius-xl:     28px;

  --shadow-sm:     0 1px 3px rgba(47,54,64,0.08), 0 1px 2px rgba(47,54,64,0.06);
  --shadow-md:     0 4px 16px rgba(47,54,64,0.10), 0 2px 6px rgba(47,54,64,0.07);
  --shadow-lg:     0 12px 40px rgba(47,54,64,0.13), 0 4px 12px rgba(47,54,64,0.08);
  --shadow-copper: 0 4px 20px rgba(184,115,51,0.22);

  --transition:    0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--cream);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* --- Background Texture --- */
.bg-texture {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(184,115,51,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 90% 100%, rgba(47,54,64,0.06) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
}

/* --- Page Wrapper --- */
.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

/* --- Header --- */
.site-header {
  margin-bottom: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--cream-dark);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.logo-mark {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--copper), var(--copper-light));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-copper);
  flex-shrink: 0;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  color: var(--slate-dark);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.site-subtitle {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--copper);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 2px;
}

.header-tagline {
  font-size: 17px;
  color: var(--text-secondary);
  font-weight: 300;
  font-style: italic;
  font-family: var(--font-display);
  padding-left: 68px;
}

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(184,115,51,0.10);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--copper), var(--copper-light), transparent);
  opacity: 0.6;
}

.card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--copper);
  margin-bottom: 24px;
}

/* --- Inputs Card --- */
.inputs-card {
  margin-bottom: 28px;
}

.inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 32px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-dark);
  cursor: pointer;
}

.label-icon {
  font-size: 16px;
  line-height: 1;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--slate-light);
  pointer-events: none;
  z-index: 1;
}

.input-field {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--cream);
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  -moz-appearance: textfield;
  appearance: textfield;
}

.input-field::-webkit-outer-spin-button,
.input-field::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.input-field.has-prefix {
  padding-left: 28px;
}

.input-field:focus {
  border-color: var(--copper);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(184,115,51,0.12);
}

.input-field:hover:not(:focus) {
  border-color: var(--copper-light);
}

.input-unit {
  position: absolute;
  right: 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  pointer-events: none;
  white-space: nowrap;
}

.input-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --- Results Section --- */
.results-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- Cost Cards Row --- */
.costs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.cost-card {
  padding: 28px 32px;
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.cost-card--annual {
  background: linear-gradient(145deg, var(--slate-dark) 0%, var(--slate-mid) 100%);
  border-color: transparent;
}

.cost-card--annual::before {
  background: linear-gradient(90deg, var(--copper-light), var(--copper-pale), transparent);
  opacity: 0.8;
}

.cost-card--annual .card-label {
  color: var(--copper-light);
}

.cost-card--annual .cost-currency,
.cost-card--annual .cost-value {
  color: var(--white);
}

.cost-card--annual .cost-breakdown {
  color: rgba(253,250,247,0.55);
}

.cost-display {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 10px;
  line-height: 1;
}

.cost-currency {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--copper);
  margin-top: 6px;
  line-height: 1;
}

.cost-value {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 52px);
  font-weight: 900;
  color: var(--slate-dark);
  letter-spacing: -0.03em;
  line-height: 1;
  transition: color 0.15s ease;
}

.cost-value.updating {
  color: var(--copper);
}

.cost-breakdown {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.5;
}

/* --- Chart Card --- */
.chart-card {
  padding: 28px 32px;
}

.chart-container {
  position: relative;
  height: 200px;
  margin-bottom: 16px;
}

.chart-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Alternatives Card --- */
.alternatives-card {
  background: linear-gradient(145deg, #FBF6F0 0%, var(--white) 100%);
}

.alternatives-intro {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-style: italic;
  font-family: var(--font-display);
}

.alternatives-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alt-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--cream-dark);
  box-shadow: var(--shadow-sm);
  animation: slideIn 0.3s ease both;
  transition: transform var(--transition), box-shadow var(--transition);
}

.alt-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

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

.alt-emoji {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.alt-text {
  flex: 1;
}

.alt-quantity {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--copper);
  line-height: 1.1;
}

.alt-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* --- Footer --- */
.site-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--cream-dark);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .page-wrapper {
    padding: 28px 16px 48px;
  }

  .inputs-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .costs-row {
    grid-template-columns: 1fr;
  }

  .header-tagline {
    padding-left: 0;
    margin-top: 8px;
  }

  .card {
    padding: 22px 20px;
  }

  .cost-value {
    font-size: 40px;
  }
}

/* --- Utility: number animation flash --- */
@keyframes flash {
  0%   { opacity: 1; }
  30%  { opacity: 0.4; }
  100% { opacity: 1; }
}

.flash {
  animation: flash 0.35s ease;
}