/* Shared widget styles for the Anchor Text Composition Scorer */

.js-anchor {
  max-width: 620px;
  margin: 8px 0 28px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 1.25rem;
}
.js-anchor * { box-sizing: border-box; }

.js-anchor-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.js-anchor-brand-name {
  color: #f4f7fb;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.js-anchor-brand-name a {
  color: inherit;
  text-decoration: none;
}

.js-anchor-brand-name a:hover,
.js-anchor-brand-name a:focus-visible {
  color: #8fe39f;
}

.js-anchor-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
}

.js-anchor-toggle button {
  border: none;
  background: transparent;
  color: #9aa5b1;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.js-anchor-toggle button.is-active {
  background: #8fe39f;
  color: #08100b;
}

.js-anchor-mode-note {
  margin: 0 0 16px;
  color: #8f9aa6;
  font-size: 0.85rem;
  line-height: 1.6;
}

.js-anchor-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.js-anchor-field {
  display: grid;
  gap: 6px;
}

.js-anchor-field label {
  color: #cdd6df;
  font-size: 0.82rem;
  font-weight: 600;
}

.js-anchor-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: #f1f5f9;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.js-anchor-input:focus {
  border-color: rgba(143, 227, 159, 0.65);
}

.js-anchor-textarea {
  width: 100%;
  min-height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: #f1f5f9;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.6;
  outline: none;
  resize: vertical;
  margin-bottom: 4px;
  transition: border-color 0.2s ease;
}

.js-anchor-textarea:focus {
  border-color: rgba(143, 227, 159, 0.65);
}

.js-anchor-hint {
  margin: 0 0 14px;
  color: #8f9aa6;
  font-size: 0.82rem;
  line-height: 1.6;
}

.js-anchor-analyze {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  border: none;
  font-size: 0.92rem;
  font-weight: 700;
  color: #08100b;
  background: linear-gradient(135deg, #b8ff85 0%, #7de8a1 100%);
  cursor: pointer;
  margin-bottom: 18px;
  transition: transform 0.2s ease;
}

.js-anchor-analyze:hover,
.js-anchor-analyze:focus-visible {
  transform: translateY(-1px);
}

.js-anchor-results {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

.js-anchor-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.js-anchor-total {
  color: #8f9aa6;
  font-size: 0.85rem;
}

.js-anchor-verdict {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.js-anchor-bar-row {
  margin-bottom: 12px;
}

.js-anchor-bar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 0.86rem;
}

.js-anchor-bar-name {
  color: #e3e9ef;
  font-weight: 600;
}

.js-anchor-bar-pct {
  color: #c0cad4;
  font-variant-numeric: tabular-nums;
}

.js-anchor-bar-tag {
  margin-left: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
}

.js-anchor-bar-tag.ok { background: rgba(143, 227, 159, 0.15); color: #8fe39f; }
.js-anchor-bar-tag.caution { background: rgba(242, 193, 78, 0.15); color: #f2c14e; }
.js-anchor-bar-tag.flag { background: rgba(255, 107, 107, 0.15); color: #ff9b9b; }

.js-anchor-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.js-anchor-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}

.js-anchor-notes {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.js-anchor-notes-title {
  margin: 0 0 8px;
  color: #f4f7fb;
  font-size: 0.86rem;
  font-weight: 700;
}

.js-anchor-notes ul {
  margin: 0;
  padding-left: 18px;
}

.js-anchor-notes li {
  color: #aeb8c2;
  font-size: 0.88rem;
  line-height: 1.65;
  margin-bottom: 6px;
}

.js-anchor-empty {
  color: #8f9aa6;
  font-size: 0.9rem;
  padding: 6px 0 2px;
}

.js-anchor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.js-anchor-copy {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: #e3e9ef;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.js-anchor-copy:hover,
.js-anchor-copy:focus-visible {
  border-color: rgba(143, 227, 159, 0.5);
  color: #8fe39f;
}

.js-anchor-copy-status {
  font-size: 11px;
  color: #8fe39f;
}

@media (max-width: 560px) {
  .js-anchor-fields {
    grid-template-columns: 1fr;
  }
}
