/**
 * P-20: 共通コンポーネント（トークンは tailwind.config.js の yce.tone.* と併用）
 */

.yce-ui-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.yce-ui-badge--neutral {
  color: #334155;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.yce-ui-badge--info {
  color: #1e40af;
  background: #dbeafe;
  border-color: #bfdbfe;
}

.yce-ui-badge--warn {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.yce-ui-badge--success {
  color: #065f46;
  background: #d1fae5;
  border-color: #a7f3d0;
}

.yce-ui-badge--danger {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}

.yce-ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-weight: 700;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.yce-ui-btn--sm {
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
}

.yce-ui-btn--md {
  font-size: 0.875rem;
}

.yce-ui-btn--primary {
  background: #003087;
  color: #fff;
  border-color: #003087;
}

.yce-ui-btn--primary:hover {
  background: #1a4fad;
  border-color: #1a4fad;
}

.yce-ui-btn--secondary {
  background: #fff;
  color: #0d1b3e;
  border-color: #d1dcf5;
}

.yce-ui-btn--secondary:hover {
  background: #f0f4ff;
}

.yce-ui-btn--danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.yce-ui-btn--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.yce-ui-btn:focus-visible,
.yce-ui-input:focus-visible,
.yce-ui-empty-cta:focus-visible,
.yce-admin-inbox-chip:focus-visible,
.yce-mp-onboard-dismiss:focus-visible {
  outline: 2px solid #003087;
  outline-offset: 2px;
}

.yce-ui-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.yce-ui-field-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0d1b3e;
}

.yce-ui-field-req {
  color: #dc2626;
  font-size: 0.75rem;
  font-weight: 700;
}

.yce-ui-input {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  border: 1px solid #d1dcf5;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.yce-ui-field--invalid .yce-ui-input {
  border-color: #dc2626;
}

.yce-ui-field-help {
  font-size: 0.75rem;
  color: #475569;
  margin: 0;
}

.yce-ui-field-error {
  font-size: 0.75rem;
  color: #dc2626;
  margin: 0;
}

.yce-ui-empty {
  text-align: center;
  padding: 2rem 1rem;
  border-radius: 1rem;
  border: 1px dashed #d1dcf5;
  background: #f8fafc;
}

.yce-ui-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0d1b3e;
  margin: 0 0 0.5rem;
}

.yce-ui-empty-body {
  font-size: 0.875rem;
  color: #475569;
  margin: 0 0 1rem;
}

.yce-ui-error-summary {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.yce-ui-error-summary-title {
  font-weight: 700;
  color: #991b1b;
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
}

.yce-ui-error-summary-list {
  margin: 0;
  padding-left: 1.25rem;
  color: #7f1d1d;
  font-size: 0.8125rem;
}

.yce-ui-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
}

.yce-ui-stepper--compact {
  gap: 0.25rem 0.35rem;
}

.yce-ui-step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #475569;
}

.yce-ui-step.is-current {
  color: #003087;
  font-weight: 700;
}

.yce-ui-step.is-done {
  color: #047857;
}

.yce-ui-step-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 0.6875rem;
  font-weight: 700;
}

.yce-ui-step.is-current .yce-ui-step-mark {
  background: #003087;
  color: #fff;
}

.yce-ui-step-mark.is-done,
.yce-ui-step.is-done .yce-ui-step-mark {
  background: #d1fae5;
  color: #065f46;
}

.yce-ui-step-label {
  white-space: nowrap;
}

/* エントリーウィザード: 共通ボタンを既存レイアウトに合わせる */
.yce-ew-footer .yce-ui-btn--secondary {
  flex: 1;
}

.yce-ew-footer .yce-ui-btn--primary {
  flex: 2;
}

.yce-ew-footer {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* P-30: ゲート型チェックリスト */
.yce-gate {
  border: 1px solid #c7d2fe;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  max-width: 720px;
  margin: 0 0 1rem;
}

.yce-gate--compact {
  padding: 0.75rem 0.85rem;
}

.yce-gate--danger {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fef2f2 0%, #fff 100%);
}

.yce-gate-title {
  font-size: 14px;
  font-weight: 900;
  color: #1e293b;
  margin: 0 0 0.35rem;
}

.yce-gate-lead {
  font-size: 11px;
  color: #64748b;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.yce-gate-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.yce-gate-step {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.55rem 0.65rem;
}

.yce-gate-step.is-done {
  border-color: #a7f3d0;
  background: #f0fdf4;
}

.yce-gate-check {
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: transparent;
  margin-top: 0.05rem;
}

.yce-gate-check.is-done {
  border-color: #059669;
  background: #059669;
  color: #fff;
}

.yce-gate-step-title {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.15rem;
}

.yce-gate-step-desc {
  font-size: 10px;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
}

.yce-gate-step-hint {
  font-size: 10px;
  color: #b45309;
  margin: 0.35rem 0 0;
}

.yce-gate-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.yce-gate-btn {
  font-size: 11px;
  font-weight: 800;
  padding: 0.35rem 0.65rem;
  border-radius: 0.65rem;
  border: none;
  background: #003087;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.yce-gate-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.yce-gate-btn--secondary {
  background: #fff;
  color: #003087;
  border: 1px solid #cbd5e1;
}

.yce-gate-link {
  font-size: 11px;
  font-weight: 800;
  color: #003087;
}

.yce-gate-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 900;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
}

.yce-gate-badge--success {
  color: #065f46;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
}

.yce-gate-badge--info {
  color: #1e40af;
  background: #dbeafe;
  border: 1px solid #93c5fd;
}

.yce-gate-badge--warn {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
}

.yce-gate-error {
  font-size: 11px;
  color: #b91c1c;
  margin: 0.65rem 0 0;
}

.yce-gate--compact .yce-gate-step {
  padding: 0.4rem 0.5rem;
}

.yce-gate--compact .yce-gate-step-desc {
  display: none;
}

@media (max-width: 480px) {
  .yce-gate {
    max-width: none;
  }
}
