/* ============================================
   APP.CSS — Калькулятор уповноважених осіб
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');

/* === Design Tokens === */
:root {
  --font: 'Manrope', 'Roboto', -apple-system, sans-serif;
  --teal: #02818a;
  --teal-dark: #026a72;
  --teal-light: #7fcdbb;
  --text: #1c1c2e;
  --text-muted: #64748b;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.09), 0 1px 4px rgba(0,0,0,0.05);
  --shadow-teal: 0 6px 24px rgba(2, 129, 138, 0.30);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Global Typography === */
body,
.mdl-layout,
.mdl-list,
.mdl-checkbox__label,
select, input, button {
  font-family: var(--font) !important;
  -webkit-font-smoothing: antialiased;
}

/* === Mobile-only logo (scrolls with content) === */
.mobile-logo {
  display: none;
}

@media screen and (max-width: 1024px) {
  .mobile-logo {
    display: block;
    padding: 12px 20px;
    background: linear-gradient(150deg, #f5eef8 0%, #ece2f0 50%, #e4eef8 100%);
  }
}

/* === Header === */
.mdl-layout__header {
  background: linear-gradient(150deg, #f5eef8 0%, #ece2f0 50%, #e4eef8 100%) !important;
  box-shadow: none !important;
}

.mdl-layout__header-row {
  padding: 0 24px !important;
}

/* === Notification Banner === */
#close_ {
  background: linear-gradient(90deg, var(--teal-dark), var(--teal)) !important;
  font-size: 13px;
  font-family: var(--font) !important;
  letter-spacing: 0.01em;
  padding: 10px 20px !important;
}

/* === Hero Grid (lavender background override) === */
.mdl-grid[style*="#ece2f0"] {
  background: linear-gradient(150deg, #f5eef8 0%, #ece2f0 45%, #e4eef5 100%) !important;
  padding-top: 28px !important;
  padding-bottom: 36px !important;
}

/* === Hero Title === */
#main_title h2 {
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
  line-height: 1.15 !important;
}

#main_title h2 span {
  color: var(--text) !important;
  background: rgba(255,255,255,0.5) !important;
  padding: 4px 12px !important;
  border-radius: 4px !important;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* === Intro Links List === */
.mdl-list__item {
  padding: 4px 0 !important;
  min-height: unset !important;
}

.mdl-list__item-primary-content a {
  color: #3d3d52 !important;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  transition: color 0.15s var(--ease);
  font-family: var(--font) !important;
}

.mdl-list__item-primary-content a:hover {
  color: var(--teal) !important;
  text-decoration-style: solid;
}

/* === Inputs === */
input {
  width: 60px;
  padding: 2px 6px;
  border: none;
  border-bottom: 2px solid var(--teal-light);
  text-align: center;
  font-size: 16px;
  background: transparent;
  outline: none;
  transition: border-bottom-color 0.2s var(--ease);
  border-radius: 0;
  color: var(--text);
  font-family: var(--font) !important;
  font-weight: 600;
}

input:focus {
  border-bottom-color: var(--teal);
}

/* === Dynamic content area === */
div.dynamic {
  min-height: 28px;
}

/* === Calculator card header === */
.card-header {
  font-weight: 700;
  font-size: 11px;
  padding-bottom: 10px;
  line-height: 1.4;
  color: var(--text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.card-header .icon {
  flex-shrink: 0;
  margin-top: 1px;
}

/* === Calculator cards === */
.border {
  padding: 16px 14px;
  background: var(--white);
  font-size: 13px;
  line-height: 1.65;
  color: #4a5568;
  border: 1px solid #e8edf2;
  border-left: 3px solid var(--teal-light);
  border-radius: 0 8px 8px 0;
  width: 158px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.22s var(--ease),
              border-left-color 0.22s var(--ease),
              transform 0.22s var(--ease);
  box-sizing: border-box;
}

.border:hover {
  box-shadow: var(--shadow-md);
  border-left-color: var(--teal);
}

/* === Plus/Minus connector SVG wrappers === */
.border_plus {
  width: 26px;
  min-width: 26px;
  padding: 0 2px;
  align-self: center;
  flex-shrink: 0;
}

.border_plus svg {
  display: block;
  margin: 0 auto;
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

/* === Above-threshold card === */
#above_ {
  width: 310px;
  flex-shrink: 0;
}

/* === Results card === */
#results {
  background: linear-gradient(145deg, var(--teal) 0%, var(--teal-dark) 100%);
  border: none;
  border-radius: 10px;
  padding: 20px 16px;
  box-shadow: var(--shadow-teal);
  text-align: center;
  color: var(--white);
  width: 170px;
  flex-shrink: 0;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

#results::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}

#results::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  pointer-events: none;
}

.result-metric {
  margin-bottom: 12px;
  position: relative;
}

.result-metric:last-child {
  margin-bottom: 0;
}

.result-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  line-height: 1.4;
  margin-bottom: 4px;
}

.result-value {
  font-weight: 700;
  font-size: 20px;
  color: var(--white);
  line-height: 1.2;
}

.result-value--large {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -2px;
  margin-top: 2px;
  color: var(--white);
  line-height: 1;
}

.result-divider {
  border-top: 1px solid rgba(255,255,255,0.15);
  margin: 12px 0;
}

/* override any stray inline styles on result values */
#TOTAL_time,
#TOTAL_people,
#TOTAL_people_round_up {
  color: var(--white) !important;
}

/* === Loading spinner === */
.loadings {
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
  padding: 5px;
  border: 3px solid rgba(127,205,187,0.25);
  border-right-color: var(--teal-light);
  border-radius: 12px;
  animation: rotate 0.75s infinite linear;
  -webkit-animation: rotate 0.75s infinite linear;
}

@keyframes rotate {
  100% { transform: rotate(360deg); }
}
@-webkit-keyframes rotate {
  100% { -webkit-transform: rotate(360deg); }
}

/* === Hide burger menu button === */
.mdl-layout__drawer-button {
  display: none !important;
}

/* === Partners images === */
#partners {
  width: 100%;
  max-width: 320px;
  display: block;
  opacity: 0.8;
}

/* === Search block === */
#search_block {
  background: var(--teal);
  padding-bottom: 28px;
}

/* === Hero title (existing, kept for reference) === */
#main_title h2 span {
  line-height: 1.4;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* === SVG decoration on mobile === */
.svg-hero {
  /* visible on desktop by default */
}

/* === Center utility === */
.center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* === Initially hidden until org is selected === */
.inv {
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

/* === CPV table row === */
.flex_horiz {
  display: flex;
  flex-direction: row;
  margin-bottom: 6px;
  border-bottom: 1px solid #f0f4f8;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  padding-bottom: 6px;
}

.flex_horiz:last-child {
  border-bottom: none;
}

/* === Calculator flex container === */
.flex_calc {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  padding: 20px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 auto;
  background: #f5f7fa;
}

/* === Toggle buttons (люди / ставки) === */
.c-btn {
  padding: 4px 10px;
  border: solid 1px var(--teal-light);
  display: inline-block;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
  user-select: none;
  -webkit-user-select: none;
}

.c-btn-select {
  background-color: var(--teal-light);
  color: var(--white);
}

.c-btn:hover,
.c-btn:focus {
  background-color: var(--teal-light);
  color: var(--white);
}

.c-btn-group {
  display: inline-flex;
  border: 1px solid var(--teal-light);
  overflow: hidden;
  border-radius: 20px;
}

.c-btn-group > .c-btn {
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--teal-light);
}

.c-btn-group > .c-btn:last-child {
  border-right: none;
}

.c-btn-group--block {
  display: flex;
}

.c-btn-group--block > .c-btn {
  flex-grow: 1;
}

/* === Close banner === */
#close:hover {
  cursor: pointer;
  opacity: 0.65;
}

/* === Above threshold select dropdown === */
#changeRowsAbove {
  font-size: 12px;
  font-family: var(--font) !important;
  padding: 4px 10px;
  border: 1px solid #dde4ea;
  border-radius: 6px;
  background: #f8f9fb;
  color: #334155;
  margin-bottom: 8px;
  cursor: pointer;
  outline: none;
  display: block;
  transition: border-color 0.15s var(--ease);
}

#changeRowsAbove:focus {
  border-color: var(--teal);
  background: var(--white);
}

/* === Info/question icon buttons === */
.icon {
  display: inline-block;
  vertical-align: middle;
  margin-left: 3px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s var(--ease);
}

.icon:hover {
  opacity: 0.9;
}

.icon img {
  width: 13px;
  height: 13px;
  vertical-align: middle;
}

/* === Footer === */
.mdl-mega-footer {
  background: #141424 !important;
}

.mdl-mega-footer__middle-section {
  border-top: 1px solid rgba(255,255,255,0.06) !important;
  padding-top: 32px !important;
}

.mdl-mega-footer__heading {
  font-family: var(--font) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: rgba(255,255,255,0.35) !important;
}

.mdl-mega-footer__link-list a,
.mdl-mega-footer__link-list li a {
  font-family: var(--font) !important;
  color: rgba(255,255,255,0.7) !important;
  transition: color 0.15s !important;
  font-size: 14px !important;
  font-weight: 400 !important;
}

.mdl-mega-footer__link-list a:hover {
  color: var(--teal-light) !important;
}

.mdl-mega-footer__drop-down-section {
  font-family: var(--font) !important;
  font-size: 13px !important;
  color: rgba(255,255,255,0.55) !important;
  line-height: 1.7 !important;
}

.mdl-mega-footer__drop-down-section p {
  color: rgba(255,255,255,0.55) !important;
}

.mdl-mega-footer__drop-down-section a {
  color: rgba(255,255,255,0.7) !important;
}

.mdl-mega-footer__drop-down-section a:hover {
  color: var(--teal-light) !important;
}

/* === Org stats chips === */
.stat-chips {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  margin-top: 14px;
}

.stat-chip {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 72px;
  text-align: center;
}

.stat-chip__value {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.stat-chip__label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Medium desktop — slightly tighter cards */
@media screen and (max-width: 1280px) {
  .border {
    width: 138px;
    padding: 12px 10px;
  }

  #above_ {
    width: 260px;
  }

  #results {
    width: 150px;
  }
}

/* Tablets — switch to vertical column layout */
@media screen and (max-width: 840px) {
  .flex_calc {
    flex-direction: column;
    align-items: center;
    overflow-x: visible;
    padding: 12px 16px;
  }

  .border {
    width: 100%;
    max-width: 580px;
    box-sizing: border-box;
    border-left: none;
    border-top: 3px solid var(--teal-light);
    border-radius: 0 0 8px 8px;
    flex-shrink: 1;
  }

  .border:hover {
    border-top-color: var(--teal);
  }

  .border_plus {
    width: 100%;
    max-width: 580px;
    text-align: center;
    padding: 2px 0;
    min-width: unset;
    flex-shrink: 1;
  }

  .border_plus svg {
    transform: rotate(90deg);
    width: 18px;
    height: 18px;
  }

  #above_ {
    width: 100%;
    max-width: 580px;
    min-width: unset;
    height: auto !important;
    flex-shrink: 1;
    border-left: none;
    border-top: 3px solid var(--teal-light);
    border-radius: 0 0 8px 8px;
  }

  /* Results card spans full width, laid out as a row */
  #results {
    width: 100%;
    max-width: 580px;
    min-width: unset;
    box-sizing: border-box;
    flex-shrink: 1;
    border-radius: 10px;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 16px 12px;
  }

  .result-metric {
    flex: 1;
    margin-bottom: 0;
  }

  .result-divider {
    width: 1px;
    height: 48px;
    border-top: none;
    border-left: 1px solid rgba(255,255,255,0.2);
    margin: 0 10px;
    align-self: center;
  }

  #invi {
    display: none;
  }
}

/* Mobile stat chips — 2x2 grid, bar chart centered */
@media screen and (max-width: 840px) {
  /* Chips: строго 2 колонки */
  .stat-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex-wrap: unset;
  }

  .stat-chip {
    flex: unset;
    min-width: unset;
  }

  /* Центруємо label "Орієнтовна кількість" */
  .mdl-grid.inv .mdl-cell--2-col {
    text-align: center !important;
  }

  /* Барчарт на всю ширину */
  .mdl-cell--3-col {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .mdl-cell--3-col .c-btn-group {
    display: flex !important;
    width: fit-content !important;
    margin: 0 auto !important;
  }

  .bar-chart-cell {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  #bar {
    width: 200px;
    margin: 0 auto;
    display: block;
  }

  #bar svg {
    width: 200px !important;
    height: auto !important;
    display: block;
  }
}

/* Phones */
@media screen and (max-width: 520px) {
  /* Results back to column on small phones */
  #results {
    flex-direction: column;
    align-items: stretch;
  }

  .result-metric {
    margin-bottom: 8px;
  }

  .result-divider {
    width: 100%;
    height: auto;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin: 4px 0;
    align-self: auto;
  }

  .border {
    font-size: 12px;
    padding: 11px 10px;
  }

  input {
    width: 52px;
    font-size: 15px;
  }

  .svg-hero {
    display: none;
  }

  .result-value--large {
    font-size: 36px;
  }
}


/* Promo courses block */
.courses-promo {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 32px 24px;
  background: #f5f5f5;
}

.courses-promo a {
  flex: 1 1 160px;
  max-width: 220px;
  border-radius: 8px;
  overflow: hidden;
  display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform 0.15s, box-shadow 0.15s;
}

.courses-promo a:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

.courses-promo a img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 600px) {
  .courses-promo {
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
  }

  .courses-promo a {
    width: 100%;
    max-width: 360px;
    flex: none;
  }
}

/* New footer — matches cep.kse.ua */
.site-footer {
  background: linear-gradient(rgb(26, 31, 43) 0%, rgb(17, 20, 24) 100%);
  color: rgb(200, 208, 220);
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #3fd4ad, transparent);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 32px 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.site-footer h4 {
  color: #fff;
  margin-bottom: 18px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-footer p {
  color: rgb(160, 168, 184);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 10px;
}

.site-footer a {
  color: rgb(200, 208, 220);
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: #3fd4ad;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  font-size: 15px;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: rgb(200, 208, 220);
  transition: 0.25s;
}

.footer-social a:hover {
  background: #3fd4ad;
  border-color: #3fd4ad;
  color: #0d2137;
}

.footer-bottom {
  text-align: center;
  padding: 20px 0 0;
  margin-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-bottom p {
  margin: 0;
  font-size: 14px;
  color: rgb(107, 114, 128);
}
