/* ============================================
   BAC CALCULATOR — SmartTools Legal
   Prefix: bac-
   Category color: #1e1b4b (dark indigo)
   ============================================ */

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

.bac-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: #1e293b;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  max-width: 960px;
  margin: 0 auto;
}

/* ---- HEADER ---- */
.bac-header {
  background: #1e1b4b;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.bac-header-icon {
  font-size: 36px;
  line-height: 1;
}

.bac-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}

.bac-subtitle {
  font-size: 13px;
  color: #c7d2fe;
  margin: 0;
}

/* ---- BODY ---- */
.bac-body {
  display: flex;
  flex-direction: column;
}

@media (min-width: 720px) {
  .bac-body {
    flex-direction: row;
    align-items: flex-start;
  }
  .bac-form {
    width: 48%;
    border-right: 1px solid #e2e8f0;
  }
  .bac-results {
    width: 52%;
    position: sticky;
    top: 20px;
  }
}

/* ---- FORM ---- */
.bac-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bac-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bac-label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Input */
.bac-input-wrap {
  flex: 1;
}

.bac-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
  color: #1e293b;
  background: #f8fafc;
  appearance: textfield;
  -moz-appearance: textfield;
  outline: none;
  transition: border 0.2s;
}

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

.bac-input:focus {
  border-color: #6366f1;
  background: #fff;
}

.bac-input-sm {
  width: 72px;
  padding: 8px 10px;
  font-size: 13px;
}

.bac-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Choice Buttons */
.bac-choices {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bac-choice {
  padding: 8px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.bac-choice:hover {
  border-color: #6366f1;
  color: #ffffff;
}

.bac-choice.active {
  background: #1e1b4b;
  border-color: #1e1b4b;
  color: #fff;
  font-weight: 600;
}

/* Drink Type Buttons */
.bac-drink-types {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.bac-drink-btn {
  padding: 7px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.bac-drink-btn:hover {
  border-color: #6366f1;
}

.bac-drink-btn.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
  font-weight: 600;
}

/* Drink Counter */
.bac-drink-counter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.bac-count-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #6366f1;
  background: #fff;
  color: #4f46e5;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bac-count-btn:hover {
  background: #4f46e5;
  color: #fff;
}

#bac-drink-count {
  font-size: 26px;
  font-weight: 700;
  color: #1e1b4b;
  min-width: 32px;
  text-align: center;
}

.bac-drink-label {
  font-size: 12px;
  color: #64748b;
}

/* Custom ABV row */
.bac-custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.bac-small-label {
  font-size: 12px;
  color: #64748b;
}

/* Slider */
.bac-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bac-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  outline: none;
}

.bac-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4f46e5;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.bac-slider-val {
  font-size: 14px;
  font-weight: 600;
  color: #1e1b4b;
  min-width: 50px;
}

/* Select */
.bac-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23475569'/%3E%3C/svg%3E") no-repeat right 14px center;
  appearance: none;
  cursor: pointer;
  outline: none;
}

.bac-select:focus {
  border-color: #6366f1;
}

/* Disclaimer */
.bac-disclaimer {
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  color: #713f12;
  line-height: 1.5;
}

/* ---- RESULTS ---- */
.bac-results {
  padding: 24px;
  background: #eef2ff;
  min-height: 300px;
}

/* Placeholder */
#bac-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 14px;
  text-align: center;
}

.bac-ph-icon {
  font-size: 48px;
}

.bac-ph-text {
  color: #64748b;
  font-size: 14px;
  max-width: 220px;
  line-height: 1.5;
}

/* Hero Card */
.bac-hero {
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  margin-bottom: 12px;
  background: #fff;
  border: 2px solid #e2e8f0;
  transition: all 0.3s;
}

.bac-hero-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 6px;
}

.bac-hero-value {
  font-size: 52px;
  font-weight: 800;
  color: #1e1b4b;
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.bac-hero-sub {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
}

/* Verdict */
.bac-verdict {
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  background: #dcfce7;
  color: #15803d;
  transition: all 0.3s;
}

#bac-verdict-icon {
  font-size: 20px;
}

/* Stats Grid */
.bac-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.bac-stat {
  background: #fff;
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.bac-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: #1e1b4b;
}

.bac-stat-lbl {
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.3;
}

/* Breakdown */
.bac-breakdown {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid #e2e8f0;
}

.bac-bk-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 10px;
}

.bac-bk-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  color: #475569;
}

.bac-bk-row:last-child {
  border-bottom: none;
}

.bac-bk-total {
  font-weight: 700;
  color: #1e1b4b;
  font-size: 14px;
}

/* Impairment Scale */
.bac-scale-box {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
}

.bac-scale-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 12px;
  color: #475569;
  transition: all 0.2s;
}

.bac-scale-row:last-child {
  margin-bottom: 0;
}

.bac-scale-row.active-scale {
  font-weight: 700;
  color: #1e293b;
}

.bac-sc-range {
  font-weight: 600;
  min-width: 90px;
  font-size: 11px;
  color: #64748b;
}

.bac-scale-row.active-scale .bac-sc-range {
  color: inherit;
}

/* BAC level colors */
.bac-green  { background: #dcfce7; color: #15803d; border-color: #86efac; }
.bac-yellow { background: #fef9c3; color: #854d0e; border-color: #fde047; }
.bac-orange { background: #ffedd5; color: #9a3412; border-color: #fdba74; }
.bac-red    { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.bac-dark   { background: #c9103b; color: #ffffff;    border-color: #7c3aed; }

.scale-green  { background: #dcfce7; }
.scale-yellow { background: #fef9c3; }
.scale-orange { background: #ffedd5; }
.scale-red    { background: #fee2e2; }
.scale-dark   { background: #ede9fe; }
.scale-danger { background: #fce7f3; }

/* Mobile */
@media (max-width: 480px) {
  .bac-form, .bac-results { padding: 16px; }
  .bac-header { padding: 16px 18px; }
  .bac-header-icon { font-size: 28px; }
  .bac-title { font-size: 18px; }
  .bac-hero-value { font-size: 42px; }
  .bac-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .bac-stat-val { font-size: 15px; }
  .bac-choices { gap: 5px; }
  .bac-choice { padding: 7px 10px; font-size: 12px; }
}
