.acm-root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-contrast: #ffffff;
  --primary-hover-contrast: #ffffff;
  --bg-card: #0f172a;
  --bg-input: #1f2937;
  --border: rgba(255, 255, 255, 0.12);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-full: 9999px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  font-family: "Plus Jakarta Sans", Segoe UI, Tahoma, sans-serif;
}

.acm-root .acm-admin-notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 14px;
  line-height: 1.4;
}

.acm-root .acm-admin-notice a {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: underline;
}

.acm-root .acm-admin-notice a:hover {
  color: #1e40af;
}

.acm-root .cookie-trigger-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--primary-contrast);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45);
  z-index: 9998;
  transform: scale(0);
  opacity: 0;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.acm-root .cookie-trigger-btn.position-right {
  left: auto;
  right: 24px;
}

.acm-root .cookie-trigger-btn.position-left {
  left: 24px;
  right: auto;
}

.acm-root .cookie-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.acm-root .cookie-trigger-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.acm-root .cookie-trigger-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.acm-root .cookie-trigger-btn.visible {
  transform: scale(1);
  opacity: 1;
}

.acm-root .cookie-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: calc(100% - 48px);
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  padding: 24px;
  z-index: 9999;
  display: none;
  opacity: 1;
}

.acm-root .cookie-banner-header {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}

.acm-root .cookie-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  font-weight: 700;
}

.acm-root .cookie-title {
  color: var(--text-main);
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.acm-root .cookie-banner-body p {
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.acm-root .cookie-banner-body a,
.acm-root .cookie-modal-body a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1.5px;
  font-weight: 600;
}

.acm-root .cookie-banner-body a:hover,
.acm-root .cookie-banner-body a:focus,
.acm-root .cookie-banner-body a:focus-visible,
.acm-root .cookie-modal-body a:hover,
.acm-root .cookie-modal-body a:focus,
.acm-root .cookie-modal-body a:focus-visible {
  color: var(--primary-hover);
}

.acm-root .cookie-banner-actions,
.acm-root .footer-actions-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.acm-root .cookie-btn {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}

.acm-root .cookie-btn:focus,
.acm-root .cookie-btn:focus-visible,
.acm-root .cookie-modal-close:focus,
.acm-root .cookie-modal-close:focus-visible,
.acm-root .cookie-category-header:focus,
.acm-root .cookie-category-header:focus-visible,
.acm-root .cookie-toggle input:focus + .toggle-slider {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

#acmSettings .dnnFormItem {
  display: block !important;
  clear: both !important;
  margin-bottom: 16px;
}

#acmSettings .dnnFormItem > label {
  display: block !important;
  float: none !important;
  width: auto !important;
  margin: 0 0 6px !important;
  padding: 0 !important;
}

#acmSettings .dnnFormItem > input[type="text"],
#acmSettings .dnnFormItem > textarea {
  display: block !important;
  float: none !important;
  clear: both !important;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 !important;
}

#acmSettings .dnnFormItem > input[type="text"] {
  width: 500px !important;
}

#acmSettings .dnnFormItem > textarea {
  width: 700px !important;
}

.acm-root .cookie-btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
}

.acm-root .cookie-btn-primary:hover {
  background: var(--primary-hover);
  color: var(--primary-hover-contrast);
}

.acm-root .cookie-btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}

.acm-root .cookie-modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.86);
  z-index: 2147483000;
}

.acm-root .cookie-modal {
  width: calc(100% - 32px);
  max-width: 680px;
  max-height: 86vh;
  overflow: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  opacity: 1;
}

.acm-root .cookie-modal-header,
.acm-root .cookie-modal-footer {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.acm-root .cookie-modal-title {
  color: var(--text-main);
  margin: 0;
}

.acm-root .cookie-modal-footer {
  border-bottom: 0;
  border-top: 1px solid var(--border);
}

.acm-root .cookie-modal-close {
  border: 0;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  font-size: 20px;
}

.acm-root .cookie-category-title,
.acm-root .cookie-category-info {
  color: var(--text-main);
}

.acm-root .cookie-category-title {
  font-size: 16px;
  font-weight: 400;
}

.acm-root .cookie-modal-body {
  padding: 20px;
}

.acm-root .cookie-intro-text,
.acm-root .cookie-category-desc {
  color: #cbd5e1;
  line-height: 1.55;
}

.acm-root .cookie-category-desc {
  font-size: 16px;
}

.acm-root .cookie-categories {
  display: grid;
  gap: 14px;
}

.acm-root .cookie-category-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.acm-root .cookie-category-header {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.acm-root .cookie-category-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.acm-root .category-chevron {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.acm-root .cookie-category-item.expanded .category-chevron {
  transform: rotate(180deg);
}

.acm-root .cookie-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.acm-root .cookie-badge-essential {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.acm-root .cookie-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.acm-root .cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.acm-root .toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 34px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  transition: var(--transition-fast);
}

.acm-root .toggle-slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  border-radius: 50%;
  background: #fff;
  transition: var(--transition-fast);
}

.acm-root .cookie-toggle input:checked + .toggle-slider {
  background: var(--primary);
  border-color: var(--primary);
}

.acm-root .cookie-toggle input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.acm-root .cookie-category-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal);
}

.acm-root .cookie-category-content-inner {
  padding: 4px 14px 14px;
}

.acm-root .cookie-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 12px;
  background: rgba(15, 23, 42, 0.55);
}

.acm-root .cookie-table,
.acm-root .cookie-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 16px;
  line-height: 1.5;
}

.acm-root .cookie-table th,
.acm-root .cookie-table td,
.acm-root .cookie-table-wrapper th,
.acm-root .cookie-table-wrapper td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.acm-root .cookie-table th {
  background: var(--bg-input);
}

.acm-root .cookie-table-wrapper th {
  background: rgba(30, 41, 59, 0.95);
  color: #e2e8f0;
  font-weight: 700;
}

.acm-root .cookie-table-wrapper td {
  color: #e5e7eb;
  font-size: 16px;
  font-weight: 400;
}
.acm-root .cookie-table-wrapper td:first-child {
  color: #f3f4f6;
}

.acm-root .cookie-table-wrapper tr:last-child td {
  border-bottom: 0;
}

.acm-root .cookie-table-wrapper td:first-child,
.acm-root .cookie-table-wrapper th:first-child {
  width: 18%;
}

.acm-root .cookie-table-wrapper td:nth-child(2),
.acm-root .cookie-table-wrapper th:nth-child(2) {
  width: 22%;
}

.acm-root .cookie-table-wrapper td:nth-child(3),
.acm-root .cookie-table-wrapper th:nth-child(3) {
  width: 22%;
  word-break: normal;
  overflow-wrap: normal;
  white-space: normal;
}

.acm-root .cookie-table-wrapper td:nth-child(4),
.acm-root .cookie-table-wrapper th:nth-child(4) {
  width: 38%;
}

.acm-root .cookie-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: #10b981;
  color: #fff;
  font-weight: 600;
  z-index: 2147483001;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  opacity: 0;
}

.acm-root .cookie-toast.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 680px) {
  .acm-root .cookie-banner {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 12px;
  }

  .acm-root .cookie-modal {
    width: calc(100% - 20px);
    max-height: 92vh;
    margin: 10px;
  }

  .acm-root .cookie-modal-header,
  .acm-root .cookie-modal-body,
  .acm-root .cookie-modal-footer {
    padding: 14px;
  }

  .acm-root .cookie-modal-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .acm-root .footer-actions-right .cookie-btn,
  .acm-root .cookie-modal-footer .cookie-btn {
    width: 100%;
  }
}
