/* ============================================
   ACS Triple Play Premium Calculator Styles
   Single Grid Layout - Perfect Row Alignment
   ============================================ */

/* Reset & Base Styles */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #333333;
  background: #FFFFFF;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 707px;
  overflow: visible;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Main Calculator Container */
.tpc-calculator {
  max-width: 1140px;
  height: 707px;
  margin: 0 auto;
  padding: 54px 84px 54px 84px;
  background: #FFFFFF;
  position: relative;
  box-sizing: border-box;
}

/* ============================================
   Main Single Grid - Perfect Alignment
   ============================================ */

.tpc-main-grid {
  display: grid;
  grid-template-columns: 1fr 264px;
  column-gap: 18px;
  row-gap: 0;
  align-items: start;
  grid-auto-rows: auto;
}

/* Demographics Section - Spans both columns on row 1 */
.tpc-demographics {
  grid-column: 1 / 2;
  /* margin-bottom: 30px; */
}

.tpc-demo-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 20px;
  line-height: 1.6;
  /* margin-bottom: 8px; */
}

.tpc-demo-text {
  color: #333333;
  font-weight: 700;
  white-space: nowrap;
}

/* Inline Select Dropdowns */
.tpc-inline-select {
  padding: 2px 12px 2px 0px;
  font-size: 20px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  color: #EF9E27;
  border: none;
  border-bottom: 2px solid #333333;
  background: transparent;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333333' d='M6 9L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 12px;
  min-width: 50px;
  transition: all 0.2s ease;
}

.tpc-inline-select:hover {
  color: #D88A1F;
  border-bottom-color: #333333;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23D88A1F' d='M6 9L1 3h10z'/%3E%3C/svg%3E");
}

.tpc-inline-select:focus {
  outline: none;
  border-bottom-width: 3px;
}

.tpc-coverage-select {
  min-width: 120px;
}

/* ============================================
   LEFT COLUMN ITEMS: Products + Labels
   ============================================ */

/* Product Rows */
.tpc-product-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 15px;
  font-size: 20px;
  line-height: 1.4;
  min-height: 68px;
  padding: 0;
  margin: 0;
}

/* .tpc-product-row:nth-of-type(3) {
  margin-bottom: 10px;
} */

.tpc-product-label {
  color: #333333;
  font-weight: 700;
}

.tpc-product-subtext {
  width: 100%;
  font-size: 20px;
  color: #333333;
  font-weight: 400;
  line-height: 1.1;
  margin-top: 3px;
}

/* Spacer Row */
.tpc-spacer-row {
  height: 10px;
  margin: 0;
  padding: 0;
}

/* Label Rows (Subtotal, Total, Savings) */
.tpc-label-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 20px;
  font-weight: 700;
  color: #333333;
  text-align: right;
  min-height: 68px;
  padding: 0;
  margin: 0;
}

.tpc-label-text {
  font-weight: 700;
}

.tpc-label-text-italic {
  font-weight: 700;
  font-style: italic;
}

/* Discount Label Row (Red Text) */
.tpc-discount-label-row {
  justify-content: flex-end;
  font-size: 20px;
  font-weight: 700;
  color: #f5290a;
  letter-spacing: 0.5px;
}

.tpc-discount-text {
  text-align: right;
}

/* ============================================
   RIGHT COLUMN ITEMS: Premium Values
   ============================================ */

/* Premium Header - Row 1 */
.tpc-premium-header {
  background: #EFEFED;
  padding: 17px 32px 17px 18px;
  border-radius: 15px 15px 0 0;
  text-align: center;
  margin: 0;
}

.tpc-premium-header-title, 
.tpc-premium-header-subtitle {
  font-size: 20px;
  font-weight: 700;
  color: #333333;
  line-height: 1.3;
}

/* Value Boxes (Premium + Totals) */
.tpc-value-box {
  background: #EFEFED;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 68px;
  padding: 0 26px 0 18px;
  margin: 0;
}

/* Last value box */
.tpc-value-box:last-of-type {
  border-radius: 0 0 15px 15px;
  margin-bottom: 0;
  padding-bottom: 35px;
  padding-top: 10px;
}

.tpc-label-row:last-of-type {padding-bottom: 35px;}
.tpc-spacer-row {display: none;}

.tpc-premium-value,
.tpc-total-value {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #333333;
  padding: 10px 0;
  width: 100%;
  background: #FFFFFF;
}

.tpc-premium-value.loading {
  color: #999;
  font-style: italic;
  font-size: 16px;
  font-weight: 400;
}

.tpc-premium-value.error {
  color: #EF3F23;
  font-size: 16px;
}

/* Discount Value (Red) */
.tpc-discount-value {
  color: #f5290a;
}

/* ============================================
   Error Message
   ============================================ */

.tpc-error {
  background: #FEE;
  border: 1px solid #FCC;
  color: #C33;
  padding: 15px 20px;
  border-radius: 8px;
  margin-top: 20px;
  text-align: center;
  animation: shake 0.3s ease;
  grid-column: 1 / -1;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.tpc-error-message {
  font-size: 14px;
  font-weight: 600;
}

/* ============================================
   Mobile-Only Results Table
   ============================================ */

.tpc-mobile-results {
  display: none;
}

/* ============================================
   Responsive (Mobile)
   ============================================ */

@media (max-width: 991px) {
  .tpc-main-grid {
    grid-template-columns: 1fr 240px;
    gap: 25px;
  }
  
  .tpc-demo-line,
  .tpc-inline-select {
    font-size: 18px;
  }
  
  .tpc-product-row,
  .tpc-label-row {
    font-size: 18px;
  }
  
  .tpc-product-subtext {
    font-size: 18px;
  }
}

@media (max-width: 767px) {
  .tpc-calculator {
    padding: 20px 15px;
    height: auto;
  }
  
  .tpc-main-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  
  .tpc-demographics {
    margin-bottom: 25px;
    order: 1;
  }
  
  .tpc-demo-line {
    font-size: 20px;
    margin-bottom: 10px;
  }
  
  .tpc-inline-select {
    font-size: 20px;
  }
  
  .tpc-coverage-select {
    min-width: 100px;
  }
  
  /* Reorder: premium header first, then demographics, then products */
  .tpc-premium-header {
    order: 2;
    grid-column: 1;
  }
  
  .tpc-product-row {
    font-size: 20px;
    min-height: auto;
    order: 3;
  }
  
  .tpc-product-subtext {
    font-size: 20px;
    margin-top: 6px;
  }
  
  .tpc-label-row {
    min-height: auto;
    justify-content: flex-start;
    text-align: left;
    font-size: 15px;
    order: 3;
  }
  
  .tpc-discount-label-row {
    font-size: 16px;
    justify-content: flex-start;
  }
  
  .tpc-discount-text {
    text-align: left;
  }
  
  /* Hide desktop value boxes on mobile */
  .tpc-value-box,
  .mobile-hide {
    display: none;
  }
  
  /* Show mobile results table */
  .tpc-mobile-results {
    display: block;
    margin-top: 30px;
    background: #EFEFED;
    padding: 20px 15px;
    border-radius: 8px;
    order: 10;
  }
  
  .tpc-mobile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #D0D0CE;
  }
  
  .tpc-mobile-row:last-child {
    border-bottom: none;
  }
  
  .tpc-mobile-label {
    font-size: 20px;
    font-weight: 600;
    color: #333333;
    flex: 1;
  }
  
  .tpc-mobile-value {
    font-size: 20px;
    font-weight: 700;
    color: #333333;
    text-align: right;
    min-width: 100px;
  }
  
  .tpc-mobile-divider {
    height: 15px;
    margin: 10px 0;
  }
  
  .tpc-mobile-discount .tpc-mobile-label,
  .tpc-mobile-discount .tpc-mobile-value {
    color: #f5290a;
    font-weight: 700;
  }
  
  .tpc-mobile-savings {
    margin: 15px -15px -20px -15px;
    padding: 15px;
    border-radius: 0 0 8px 8px;
  }
  
  .tpc-mobile-savings .tpc-mobile-label {
    font-style: italic;
  }
  
  .tpc-mobile-savings .tpc-mobile-value {
    color: #337AB7;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .tpc-demo-line {
    font-size: 20px;
  }
  
  .tpc-inline-select {
    font-size: 20px;
  }
  
  .tpc-product-row {
    font-size: 20px;
  }
  
  .tpc-label-row {
    font-size: 20px;
  }
}