﻿/* ==============================================
   EmployForm Cookie Consent — efcc-banner.css
   ============================================== */

/* ── Tokens ───────────────────────────────────── */
:root {
  --efcc-green:        #1D9E75;
  --efcc-green-dark:   #0F6E56;
  --efcc-green-light:  #E1F5EE;
  --efcc-green-text:   #085041;

  --efcc-text:         #1a1a1a;
  --efcc-text-muted:   #6b7280;
  --efcc-text-subtle:  #9ca3af;

  --efcc-bg:           #ffffff;
  --efcc-bg-subtle:    #f9fafb;
  --efcc-border:       rgba(0, 0, 0, 0.10);
  --efcc-border-med:   rgba(0, 0, 0, 0.15);

  --efcc-radius-sm:    6px;
  --efcc-radius-md:    8px;
  --efcc-radius-lg:    12px;

  --efcc-shadow:       0 4px 24px rgba(0, 0, 0, 0.10), 0 1px 4px rgba(0, 0, 0, 0.06);
  --efcc-font:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --efcc-mono:         ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

  --efcc-z-banner:     9000;
  --efcc-z-overlay:    9100;
  --efcc-z-modal:      9200;

  /* Legacy aliases so wp_add_inline_style primary-colour injection still resolves */
  --efcc-primary:      var(--efcc-green);
}


/* ── Reset within plugin scope ────────────────── */
#efcc-banner *,
#efcc-overlay *,
#efcc-withdraw-wrap * {
  box-sizing: border-box;
  margin: 0;
}

#efcc-banner,
#efcc-overlay,
#efcc-withdraw-wrap,
.efcc-withdraw {
  box-sizing: border-box;
}


/* ── Banner ───────────────────────────────────── */
#efcc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  z-index: var(--efcc-z-banner);
  background: var(--efcc-bg);
  border-top: 1px solid var(--efcc-border);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.07);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--efcc-font);
  font-size: 14px;
  color: var(--efcc-text);
  overflow-x: clip;
}

.efcc-banner__text {
  flex: 1;
  min-width: 220px;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--efcc-text-muted);
}

.efcc-banner__text a {
  color: var(--efcc-primary);
  text-decoration: none;
}

.efcc-banner__text a:hover {
  text-decoration: underline;
}

.efcc-banner__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}


/* ── Overlay ──────────────────────────────────── */
#efcc-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--efcc-z-overlay);
  background: rgba(0, 0, 0, 0.40);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  font-family: var(--efcc-font);
}

@media (min-width: 600px) {
  #efcc-overlay {
    align-items: center;
  }
}

#efcc-overlay[hidden] {
  display: none;
}


/* ── Modal ────────────────────────────────────── */
.efcc-modal {
  position: relative;
  z-index: var(--efcc-z-modal);
  background: var(--efcc-bg);
  border-radius: var(--efcc-radius-lg);
  border: 1px solid var(--efcc-border);
  box-shadow: var(--efcc-shadow);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  font-family: var(--efcc-font);
  color: var(--efcc-text);
}

.efcc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--efcc-border);
  position: sticky;
  top: 0;
  background: var(--efcc-bg);
  z-index: 1;
}

.efcc-modal__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--efcc-text);
}

.efcc-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--efcc-radius-sm);
  cursor: pointer;
  color: var(--efcc-text-muted);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.efcc-modal__close:hover {
  background: var(--efcc-bg-subtle);
  color: var(--efcc-text);
}

.efcc-modal__intro {
  padding: 14px 20px;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--efcc-text-muted);
  border-bottom: 1px solid var(--efcc-border);
}

.efcc-modal__intro a {
  color: var(--efcc-primary);
  text-decoration: none;
}

.efcc-modal__intro a:hover {
  text-decoration: underline;
}

.efcc-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--efcc-border);
  position: sticky;
  bottom: 0;
  background: var(--efcc-bg);
}


/* ── Category rows ────────────────────────────── */
.efcc-cat {
  border-bottom: 1px solid var(--efcc-border);
}

.efcc-cat:last-of-type {
  border-bottom: none;
}

.efcc-cat__header {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 6px 16px;
  padding: 16px 20px 14px;
  transition: background 0.15s;
}

.efcc-cat__header:hover {
  background: var(--efcc-bg-subtle);
}

.efcc-cat__toggle-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  grid-column: 1;
  grid-row: 1;
  font-family: var(--efcc-font);
  font-size: inherit;
  color: var(--efcc-text);
}

.efcc-cat__toggle-btn:focus-visible {
  outline: 2px solid var(--efcc-green);
  outline-offset: 2px;
  border-radius: var(--efcc-radius-sm);
}

.efcc-cat__chevron {
  flex-shrink: 0;
  color: var(--efcc-text-subtle);
  transition: transform 0.2s ease;
}

.efcc-cat__toggle-btn[aria-expanded="true"] .efcc-cat__chevron {
  transform: rotate(180deg);
}

.efcc-cat__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--efcc-text);
}

.efcc-cat__desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--efcc-text-muted);
  margin: 0;
  grid-column: 1;
  grid-row: 2;
  padding-left: 19px;
}

/* Right-column: always-on badge or toggle spans both rows */
.efcc-cat__always-on,
.efcc-toggle {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
}

.efcc-cat__always-on {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--efcc-green-text);
  background: var(--efcc-green-light);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

#efcc-overlay .efcc-cat__body {
  padding: 12px 20px 16px;
}

.efcc-cat__body[hidden] {
  display: none;
}


/* ── Data-signals pills ───────────────────────── */
#efcc-overlay .efcc-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

#efcc-overlay .efcc-signals li {
  font-size: 11.5px;
  color: var(--efcc-text-muted);
  background: var(--efcc-bg-subtle);
  border: 1px solid var(--efcc-border);
  padding: 2px 9px;
  border-radius: 20px;
}


/* ── Cookie table ─────────────────────────────── */
.efcc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--efcc-radius-md);
  border: 1px solid var(--efcc-border);
}

.efcc-table {
  width: 100%;
  font-size: 11.5px;
  border-collapse: collapse;
  color: var(--efcc-text);
}

.efcc-table thead tr {
  background: var(--efcc-bg-subtle);
}

.efcc-table th {
  text-align: left;
  font-weight: 600;
  color: var(--efcc-text-muted);
  padding: 7px 10px;
  white-space: nowrap;
}

.efcc-table td {
  padding: 7px 10px;
  border-top: 1px solid var(--efcc-border);
  color: var(--efcc-text);
  vertical-align: top;
}

.efcc-table code {
  font-family: var(--efcc-mono);
  font-size: 11px;
  background: var(--efcc-bg-subtle);
  border: 1px solid var(--efcc-border);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}


/* ── Toggle switch ────────────────────────────── */
.efcc-toggle {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 22px;
  cursor: pointer;
  flex-shrink: 0;
}

.efcc-toggle__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.efcc-toggle__slider {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: #d1d5db;
  transition: background 0.2s ease;
}

.efcc-toggle__slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.20);
  transition: transform 0.2s ease;
}

.efcc-toggle__input:checked + .efcc-toggle__slider {
  background: var(--efcc-primary);
}

.efcc-toggle__input:checked + .efcc-toggle__slider::before {
  transform: translateX(16px);
}

.efcc-toggle__input:focus-visible + .efcc-toggle__slider {
  outline: 2px solid var(--efcc-primary);
  outline-offset: 2px;
}


/* ── Buttons ──────────────────────────────────── */
.efcc-btn {
  font-family: var(--efcc-font);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--efcc-radius-md);
  cursor: pointer;
  border: 1px solid var(--efcc-border-med);
  background: transparent;
  color: var(--efcc-text);
  line-height: 1.4;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.efcc-btn:hover {
  background: var(--efcc-bg-subtle);
}

.efcc-btn:active {
  transform: scale(0.98);
}

.efcc-btn--outline {
  border-color: var(--efcc-primary);
  color: var(--efcc-primary);
}

.efcc-btn--outline:hover {
  background: var(--efcc-green-light);
  border-color: var(--efcc-primary);
  color: var(--efcc-primary);
}

.efcc-btn--primary {
  background: var(--efcc-primary);
  border-color: var(--efcc-primary);
  color: #ffffff;
}

.efcc-btn--primary:hover {
  background: var(--efcc-green-dark);
  border-color: var(--efcc-green-dark);
  color: #ffffff;
}


/* ── Withdraw consent link (footer) ───────────── */
#efcc-withdraw-wrap,
.efcc-withdraw {
  text-align: center;
  padding: 8px 0;
  max-width: 100%;
  overflow-x: hidden;
}

.efcc-withdraw-btn,
.efcc-withdraw__btn {
  background: transparent;
  border: none;
  font-size: 12px;
  color: var(--efcc-text-muted);
  cursor: pointer;
  text-decoration: underline;
  font-family: var(--efcc-font);
  padding: 4px 8px;
  border-radius: var(--efcc-radius-sm);
  transition: color 0.15s;
}

.efcc-withdraw-btn:hover,
.efcc-withdraw-btn:focus-visible,
.efcc-withdraw__btn:hover,
.efcc-withdraw__btn:focus-visible {
  color: var(--efcc-green);
  outline: none;
}

/* Link-style variant for inline use (e.g. footer) */
.efcc-withdraw__btn--link {
  font-size: inherit;
  color: inherit;
  text-decoration: underline;
  padding: 0;
  border-radius: 0;
}

.efcc-withdraw__btn--link:hover,
.efcc-withdraw__btn--link:focus-visible {
  color: inherit;
  opacity: 0.75;
  outline: none;
}


/* ── Responsive ───────────────────────────────── */
@media (max-width: 480px) {
  #efcc-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
  }

  .efcc-banner__actions {
    flex-direction: column;
  }

  .efcc-banner__actions .efcc-btn {
    width: 100%;
    text-align: center;
  }

  .efcc-modal__footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .efcc-modal__footer .efcc-btn {
    width: 100%;
    text-align: center;
  }

  .efcc-modal {
    max-height: 85vh;
  }
}
